71 IN PDLGITEMTEMPLATE DialogItem,
80 LPWSTR ClassName, WindowName;
81 WCHAR WindowIdBuf[
sizeof(
"#65535")];
87 rect.left = DialogItem->x;
88 rect.top = DialogItem->y;
89 rect.right = DialogItem->x + DialogItem->cx;
90 rect.bottom = DialogItem->y + DialogItem->cy;
95 rect.left += DialogOffset->left;
96 rect.right += DialogOffset->left;
97 rect.top += DialogOffset->top;
98 rect.bottom += DialogOffset->top;
112 ClassName =
L"button";
115 ClassName =
L"static";
138 WindowName = WindowIdBuf;
153 wID = DialogItem->id;
158 wID = DialogItem->id * (DialogIdMultiplier + 1);
183 if (!
_wcsicmp(ClassName,
L"msctls_trackbar32"))
232 else if (!
_wcsicmp(ClassName,
L"static"))
237 else if (!
_wcsicmp(ClassName,
L"button"))
282 PDLGITEMTEMPLATE DialogItem,
283 DWORD DialogIdMultiplier,
293 if (MixerWindow->Window)
297 if (!MixerWindow->Window)
308 &MixerWindow->Window[MixerWindow->WindowCount],
315 MixerWindow->MixerId);
321 DialogItem =(PDLGITEMTEMPLATE)
Offset;
324 MixerWindow->WindowCount++;
336 PDLGITEMTEMPLATE DlgItem;
388 if (!MixerWindow->hFont)
391 MixerWindow->hFont =
CreateFontW(-
pixels, 0, 0, 0,
FW_NORMAL,
FALSE,
FALSE,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY,
FF_DONTCARE, FontName);
394 if (MixerWindow->hFont)
403 xBaseUnit = charSize.
cx;
404 yBaseUnit = charSize.
cy;
408 MixerWindow->baseUnit.cx = charSize.
cx;
409 MixerWindow->baseUnit.cy = charSize.
cy;
421 DlgItem = (PDLGITEMTEMPLATE)
Offset;
424 dialogRect.
right = DlgTemplate->
cx;
426 dialogRect.
bottom = DlgTemplate->
cy;
432 dialogRect.
left += MixerWindow->rect.right;
433 dialogRect.
right += MixerWindow->rect.right;
434 dialogRect.
top += MixerWindow->rect.top;
435 dialogRect.
bottom += MixerWindow->rect.top;
437 MixerWindow->rect.right +=
width;
438 if ((dialogRect.
bottom - dialogRect.
top) > (MixerWindow->rect.bottom - MixerWindow->rect.top))
439 MixerWindow->rect.bottom = MixerWindow->rect.top + dialogRect.
bottom - dialogRect.
top;
462 if (
Line->cControls == 0)
475 if (pVolumeDetails ==
NULL)
523 if (hDlgCtrl !=
NULL)
544 DWORD volumePosition, volumeStep, maxVolume,
i;
545 DWORD balancePosition, balanceStep;
550 for (
i = 0;
i <
Line->cChannels;
i++)
552 if (pVolumeDetails[
i].dwValue > maxVolume)
553 maxVolume = pVolumeDetails[
i].dwValue;
556 volumePosition = (maxVolume -
Control[
Index].Bounds.dwMinimum) / volumeStep;
558 if (
Line->cChannels == 1)
562 else if (
Line->cChannels == 2)
564 if (pVolumeDetails[0].dwValue == pVolumeDetails[1].dwValue)
568 else if (pVolumeDetails[0].dwValue ==
Control[
Index].Bounds.dwMinimum)
572 else if (pVolumeDetails[1].dwValue ==
Control[
Index].Bounds.dwMinimum)
580 if (pVolumeDetails[0].dwValue < pVolumeDetails[1].dwValue)
582 balancePosition = (pVolumeDetails[0].dwValue -
Control[
Index].Bounds.dwMinimum) / balanceStep;
585 else if (pVolumeDetails[1].dwValue < pVolumeDetails[0].dwValue)
587 balancePosition = (pVolumeDetails[1].dwValue -
Control[
Index].Bounds.dwMinimum) / balanceStep;
599 if (hDlgCtrl !=
NULL)
607 if (OldPosition != (
VOLUME_MAX - volumePosition))
614 if (
Line->cChannels == 2)
622 if (hDlgCtrl !=
NULL)
630 if (OldPosition != balancePosition)
649 if (hDlgCtrl !=
NULL)
744 if (hDlgCtrl !=
NULL)
762 if (hDlgCtrl !=
NULL)
800 if (hDlgCtrl !=
NULL)
842 wID = (
Index + 1) * dwDialogID;
847 if (hDlgCtrl !=
NULL)
VOID UpdateDialogLineSliderControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, DWORD dwDialogID, DWORD Position)
VOID LoadDialog(IN HMODULE hModule, IN PMIXER_WINDOW MixerWindow, IN LPCWSTR DialogResId, IN DWORD Index)
VOID UpdateDialogLineSwitchControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, LONG fValue)
VOID LoadDialogCtrls(PPREFERENCES_CONTEXT PrefContext)
VOID ConvertRect(LPRECT lpRect, UINT xBaseUnit, UINT yBaseUnit)
VOID LoadDialogControls(IN PMIXER_WINDOW MixerWindow, LPRECT DialogOffset, WORD ItemCount, PDLGITEMTEMPLATE DialogItem, DWORD DialogIdMultiplier, UINT xBaseUnit, UINT yBaseUnit)
LPWORD AddDialogControl(IN HWND hwndDialog, OUT HWND *OutWnd, IN LPRECT DialogOffset, IN PDLGITEMTEMPLATE DialogItem, IN DWORD DialogIdMultiplier, IN HFONT hFont, IN UINT xBaseUnit, IN UINT yBaseUnit, IN UINT MixerId)
BOOL CALLBACK EnumConnectionsCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
LPVOID LoadDialogResource(IN HMODULE hModule, IN LPCWSTR ResourceName, OUT LPDWORD ResourceLength)
BOOL ReadLineConfig(IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN LPTSTR szControlName, OUT DWORD *Flags)
BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls)
INT SndMixerGetLineName(PSND_MIXER Mixer, DWORD LineID, LPTSTR lpBuffer, UINT uSize, BOOL LongName)
INT SndMixerGetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
#define IDC_LINE_SLIDER_VERT
#define IDM_ADVANCED_CONTROLS
#define IDC_LINE_ADVANCED
#define IDD_NORMAL_MASTER
#define IDC_LINE_SLIDER_HORZ
#define HeapFree(x, y, z)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLint GLint GLsizei width
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
#define MIXERLINE_COMPONENTTYPE_DST_HEADPHONES
#define MIXERCONTROL_CONTROLTYPE_VOLUME
#define MIXER_LONG_NAME_CHARS
#define MIXERCONTROL_CONTROLTYPE_MUTE
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define BALANCE_PAGE_SIZE
#define ADVANCED_BUTTON_HEIGHT
struct _PREFERENCES_CONTEXT * PPREFERENCES_CONTEXT
BOOL bShowExtendedControls
struct _SND_MIXER * Mixer
BOOL bHasExtendedControls
PMIXER_WINDOW MixerWindow
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDF_WMI_PROVIDER_CONTROL Control
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
LONG WINAPI GdiGetCharDimensions(HDC, LPTEXTMETRICW, LONG *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define OUT_DEFAULT_PRECIS
HFONT WINAPI CreateFontW(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR)
#define CLIP_DEFAULT_PRECIS
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
struct DLGTEMPLATE * LPDLGTEMPLATE
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
LONG WINAPI GetDialogBaseUnits(void)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMENU WINAPI GetMenu(_In_ HWND)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags