37#define GetDialogData(hwndDlg, type) \
38 ( P##type )GetWindowLongPtr((hwndDlg), DWLP_USER)
39#define GetWindowData(hwnd, type) \
40 ( P##type )GetWindowLongPtr((hwnd), GWL_USERDATA)
99 switch (
Line->dwComponentType)
112 goto AddToOthersLines;
127 goto AddToOthersLines;
179 if (
Line->cControls != 0)
185 lvi.iItem = PrefContext->
tmp++;
187 lvi.pszText =
Line->szName;
206 LineName[0] =
TEXT(
'\0');
233 INT OldID, MixerID = 0;
242 if (DeviceCbIndex !=
CB_ERR)
256 if (MixerID != OldID &&
312 (
Context->OtherLines != 0 && SelBox++ == 0) ?
322 LineID =
Context->SelectedLine;
327 if ((MixerID != OldID &&
Context->SelectedLine != (
DWORD)-1) ||
328 (
Context->SelectedLine != LineID && LineID != (
DWORD)-1))
330 Context->SelectedLine = LineID;
371 if (LineStates ==
NULL)
495 if (LineCbIndex !=
CB_ERR)
560 lvc.pszText =
TEXT(
"");
561 lvc.cx = rcClient.
right;
653 if (puDetails ==
NULL)
663 DWORD LineOffset, volumePosition, balancePosition;
664 DWORD volumeStep, balanceStep;
666 LineOffset =
Context->SliderPos;
671 if (
Line->cChannels == 1)
676 else if (
Line->cChannels == 2)
741 if (puDetails !=
NULL)
762 if (
Line->cControls == 0)
778 if (pVolumeDetails ==
NULL)
803 DWORD volumePosition, volumeStep, maxVolume,
i;
804 DWORD balancePosition, balanceStep;
809 for (
i = 0;
i <
Line->cChannels;
i++)
811 if (pVolumeDetails[
i].dwValue > maxVolume)
812 maxVolume = pVolumeDetails[
i].dwValue;
815 volumePosition = (maxVolume -
Control[
Index].Bounds.dwMinimum) / volumeStep;
817 if (
Line->cChannels == 1)
821 else if (
Line->cChannels == 2)
823 if (pVolumeDetails[0].dwValue == pVolumeDetails[1].dwValue)
827 else if (pVolumeDetails[0].dwValue ==
Control[
Index].Bounds.dwMinimum)
831 else if (pVolumeDetails[1].dwValue ==
Control[
Index].Bounds.dwMinimum)
839 if (pVolumeDetails[0].dwValue < pVolumeDetails[1].dwValue)
841 balancePosition = (pVolumeDetails[0].dwValue -
Control[
Index].Bounds.dwMinimum) / balanceStep;
844 else if (pVolumeDetails[1].dwValue < pVolumeDetails[0].dwValue)
846 balancePosition = (pVolumeDetails[1].dwValue -
Control[
Index].Bounds.dwMinimum) / balanceStep;
882 DWORD CtrlID, LineOffset;
916 sizeof(szProduct) /
sizeof(szProduct[0])) == -1)
919 szProduct[0] =
L'\0';
1047 if (AdvancedContext.
Line)
1053 (
LPARAM)&AdvancedContext);
1065 DPRINT(
"MM_MIXM_LINE_CHANGE\n");
1071 DPRINT(
"MM_MIXM_CONTROL_CHANGE\n");
1102 Context.SliderPos = LineOffset;
1121 if (LineOffset == 1 && MixerWindow->
Mixer->MixerId == 0)
1147 Context.SliderPos = LineOffset;
1166 if (LineOffset == 1 && MixerWindow->
Mixer->MixerId == 0)
1182 MixerWindow->hWnd =
hwnd;
1183 MixerWindow->Mixer =
SndMixerCreate(MixerWindow->hWnd, MixerWindow->MixerId);
1184 if (MixerWindow->Mixer !=
NULL)
1191 sizeof(szProduct) /
sizeof(szProduct[0])) == -1)
1194 szProduct[0] =
L'\0';
1235 if (MixerWindow->hStatusBar)
1246 DPRINT(
"Rebuilding mixer window controls failed!\n");
1248 MixerWindow->Mixer =
NULL;
1261 if (MixerWindow !=
NULL)
1267 if (MixerWindow->
hFont)
1345 if (MixerWindow ==
NULL)
1350 MixerWindow->
Mode = WindowMode;
1351 MixerWindow->
MixerId = MixerId;
1549 DPRINT(
"Unable to open the Volume Control registry key!\n");
INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
VOID UpdateDialogLineSliderControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, DWORD dwDialogID, DWORD Position)
VOID UpdateDialogLineSwitchControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, LONG fValue)
VOID LoadDialogCtrls(PPREFERENCES_CONTEXT PrefContext)
VOID CloseAppConfig(VOID)
DWORD GetStyleValue(VOID)
BOOL SaveXYCoordWnd(IN HWND hWnd, IN PPREFERENCES_CONTEXT PrefContext)
BOOL WriteLineConfig(IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN PSNDVOL_REG_LINESTATE LineState, IN DWORD cbSize)
BOOL LoadXYCoordWnd(IN PPREFERENCES_CONTEXT PrefContext)
BOOL ReadLineConfig(IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN LPTSTR szControlName, OUT DWORD *Flags)
BOOL SndMixerEnumLines(PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc, PVOID Context)
BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId)
VOID SndMixerDestroy(PSND_MIXER Mixer)
LPMIXERLINE SndMixerGetLineByName(PSND_MIXER Mixer, DWORD LineID, LPWSTR LineName)
BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls)
PSND_MIXER SndMixerCreate(HWND hWndNotification, UINT MixerId)
UINT SndMixerGetSelection(PSND_MIXER Mixer)
INT SndMixerGetProductName(PSND_MIXER Mixer, LPTSTR lpBuffer, UINT uSize)
INT SndMixerGetLineName(PSND_MIXER Mixer, DWORD LineID, LPTSTR lpBuffer, UINT uSize, BOOL LongName)
BOOL SndMixerEnumProducts(PSND_MIXER Mixer, PFNSNDMIXENUMPRODUCTS EnumProc, PVOID Context)
INT SndMixerGetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
INT SndMixerSetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
#define IDS_NOMIXERDEVICES
#define IDC_LINE_SLIDER_VERT
#define IDM_ADVANCED_CONTROLS
#define IDC_LINE_ADVANCED
#define IDC_LINE_SLIDER_HORZ
static INT_PTR CALLBACK AdvancedDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
#define HeapFree(x, y, z)
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
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
#define SND_ALIAS_SYSTEMDEFAULT
#define MM_MIXM_CONTROL_CHANGE
#define MIXERCONTROL_CONTROLTYPE_VOLUME
#define MIXER_LONG_NAME_CHARS
#define MIXERLINE_COMPONENTTYPE_DST_WAVEIN
#define MM_MIXM_LINE_CHANGE
#define MIXERCONTROL_CONTROLTYPE_MUTE
#define UNREFERENCED_PARAMETER(P)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define CreateStatusWindow
#define ListView_SetCheckState(hwndLV, i, fCheck)
#define ListView_GetItemText(hwndLV, i, iSubItem_, pszText_, cchTextMax_)
#define LVS_EX_CHECKBOXES
#define ListView_GetItemCount(hwnd)
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
#define ICC_STANDARD_CLASSES
#define ListView_DeleteAllItems(hwnd)
#define ListView_GetCheckState(hwndLV, i)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static BOOL RebuildMixerWindowControls(PPREFERENCES_CONTEXT PrefContext)
static VOID UpdatePrefDlgControls(PPREFERENCES_CONTEXT Context, DWORD LineID)
static BOOL HandleCommandLine(LPTSTR cmdline, DWORD dwStyle, PWINDOW_MODE pMode, PUINT pMixerId)
static HWND CreateApplicationWindow(WINDOW_MODE WindowMode, UINT MixerId)
struct _PREFERENCES_FILL_DEVICES * PPREFERENCES_FILL_DEVICES
static BOOL RegisterApplicationClasses(VOID)
static VOID UnregisterApplicationClasses(VOID)
static VOID DeleteMixerWindowControls(PMIXER_WINDOW MixerWindow)
static INT_PTR CALLBACK DlgPreferencesProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define GetWindowData(hwnd, type)
struct _PREFERENCES_FILL_DEVICES PREFERENCES_FILL_DEVICES
static LRESULT CALLBACK MainWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static BOOL CALLBACK SetVolumeCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Ctx)
static BOOL CALLBACK PrefDlgAddConnection(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
static BOOL CALLBACK MixerControlChangeCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
static BOOL CALLBACK FillDeviceComboBox(PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context)
PREFERENCES_CONTEXT Preferences
static VOID WriteLineSettings(PPREFERENCES_CONTEXT Context, HWND hwndDlg)
#define GetDialogData(hwndDlg, type)
static BOOL CALLBACK PrefDlgAddLine(PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context)
enum _WINDOW_MODE WINDOW_MODE
struct _SET_VOLUME_CONTEXT * PSET_VOLUME_CONTEXT
enum _WINDOW_MODE * PWINDOW_MODE
struct _MIXER_WINDOW * PMIXER_WINDOW
struct _PREFERENCES_CONTEXT * PPREFERENCES_CONTEXT
INT_PTR CALLBACK TrayDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
PMIXER_WINDOW MixerWindow
WCHAR LineName[MIXER_LONG_NAME_CHARS]
BOOL bShowExtendedControls
struct _SND_MIXER * Mixer
PMIXER_WINDOW MixerWindow
PPREFERENCES_CONTEXT PrefContext
TW_UINT32 TW_UINT16 TW_UINT16 MSG
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDF_WMI_PROVIDER_CONTROL Control
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetLastError(void)
UINT WINAPI mixerGetNumDevs(void)
CREATESTRUCTA * LPCREATESTRUCT
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WS_EX_CONTROLPARENT
BOOL WINAPI UnregisterHotKey(_In_opt_ HWND, _In_ int)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SYSCOLORCHANGE
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MB_ICONINFORMATION
int WINAPI GetDlgCtrlID(_In_ HWND)
#define SendDlgItemMessage
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetMenu(_In_ HWND)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
_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