ReactOS 0.4.15-dev-5672-gf73ac17
sndvol32.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <mmsystem.h>
#include <commctrl.h>
#include <tchar.h>
#include <strsafe.h>
#include <assert.h>
#include "resources.h"
Include dependency graph for sndvol32.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _MIXER_WINDOW
 
struct  _SND_MIXER_CONNECTION
 
struct  _SND_MIXER_DESTINATION
 
struct  _SND_MIXER
 
struct  _PREFERENCES_CONTEXT
 
struct  _SET_VOLUME_CONTEXT
 
struct  _ADVANCED_CONTEXT
 
struct  _SNDVOL_REG_LINESTATE
 

Macros

#define VOLUME_MIN   0
 
#define VOLUME_MAX   500
 
#define VOLUME_TICKS   5
 
#define VOLUME_PAGE_SIZE   100
 
#define BALANCE_LEFT   0
 
#define BALANCE_CENTER   32
 
#define BALANCE_RIGHT   64
 
#define BALANCE_STEPS   64
 
#define BALANCE_TICKS   1
 
#define BALANCE_PAGE_SIZE   12
 
#define PLAY_MIXER   0
 
#define RECORD_MIXER   1
 
#define ADVANCED_BUTTON_HEIGHT   16
 
#define SZ_APP_CLASS   TEXT("Volume Control")
 
#define _countof(array)   (sizeof(array) / sizeof(array[0]))
 
#define DPRINT   DbgPrint("SNDVOL32: %s:%i: ", __FILE__, __LINE__); DbgPrint
 

Typedefs

typedef enum _WINDOW_MODE WINDOW_MODE
 
typedef enum _WINDOW_MODEPWINDOW_MODE
 
typedef struct _MIXER_WINDOW MIXER_WINDOW
 
typedef struct _MIXER_WINDOWPMIXER_WINDOW
 
typedef struct _SND_MIXER_CONNECTION SND_MIXER_CONNECTION
 
typedef struct _SND_MIXER_CONNECTIONPSND_MIXER_CONNECTION
 
typedef struct _SND_MIXER_DESTINATION SND_MIXER_DESTINATION
 
typedef struct _SND_MIXER_DESTINATIONPSND_MIXER_DESTINATION
 
typedef struct _SND_MIXER SND_MIXER
 
typedef struct _SND_MIXERPSND_MIXER
 
typedef struct _PREFERENCES_CONTEXT PREFERENCES_CONTEXT
 
typedef struct _PREFERENCES_CONTEXTPPREFERENCES_CONTEXT
 
typedef struct _SET_VOLUME_CONTEXT SET_VOLUME_CONTEXT
 
typedef struct _SET_VOLUME_CONTEXTPSET_VOLUME_CONTEXT
 
typedef struct _ADVANCED_CONTEXT ADVANCED_CONTEXT
 
typedef struct _ADVANCED_CONTEXTPADVANCED_CONTEXT
 
typedef struct _SNDVOL_REG_LINESTATE SNDVOL_REG_LINESTATE
 
typedef struct _SNDVOL_REG_LINESTATEPSNDVOL_REG_LINESTATE
 
typedef BOOL(CALLBACKPFNSNDMIXENUMLINES) (PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context)
 
typedef BOOL(CALLBACKPFNSNDMIXENUMCONNECTIONS) (PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
 
typedef BOOL(CALLBACKPFNSNDMIXENUMPRODUCTS) (PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context)
 

Enumerations

enum  _WINDOW_MODE { NORMAL_MODE , SMALL_MODE , TRAY_MODE }
 

Functions

ULONG DbgPrint (PCH,...)
 
PSND_MIXER SndMixerCreate (HWND hWndNotification, UINT MixerId)
 
VOID SndMixerDestroy (PSND_MIXER Mixer)
 
VOID SndMixerClose (PSND_MIXER Mixer)
 
BOOL SndMixerSelect (PSND_MIXER Mixer, UINT MixerId)
 
UINT SndMixerGetSelection (PSND_MIXER Mixer)
 
INT SndMixerSetVolumeControlDetails (PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
 
INT SndMixerGetVolumeControlDetails (PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
 
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 SndMixerGetDestinationCount (PSND_MIXER Mixer)
 
BOOL SndMixerEnumLines (PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc, PVOID Context)
 
BOOL SndMixerEnumConnections (PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
 
BOOL SndMixerIsDisplayControl (PSND_MIXER Mixer, LPMIXERCONTROL Control)
 
BOOL SndMixerQueryControls (PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls)
 
LPMIXERLINE SndMixerGetLineByName (PSND_MIXER Mixer, DWORD LineID, LPWSTR LineName)
 
INT_PTR CALLBACK AdvancedDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID LoadDialogCtrls (PPREFERENCES_CONTEXT PrefContext)
 
VOID UpdateDialogLineSliderControl (PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, DWORD DialogID, DWORD Position)
 
VOID UpdateDialogLineSwitchControl (PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, LONG fValue)
 
BOOL InitAppConfig (VOID)
 
VOID CloseAppConfig (VOID)
 
BOOL LoadXYCoordWnd (IN PPREFERENCES_CONTEXT PrefContext)
 
BOOL SaveXYCoordWnd (IN HWND hWnd, IN PPREFERENCES_CONTEXT PrefContext)
 
INT AllocAndLoadString (OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
 
DWORD LoadAndFormatString (IN HINSTANCE hInstance, IN UINT uID, OUT LPWSTR *lpTarget,...)
 
BOOL ReadLineConfig (IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN LPTSTR szControlName, OUT DWORD *Flags)
 
BOOL WriteLineConfig (IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN PSNDVOL_REG_LINESTATE LineState, IN DWORD cbSize)
 
DWORD GetStyleValue (VOID)
 
INT_PTR CALLBACK TrayDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hAppInstance
 
ATOM MainWindowClass
 
HWND hMainWnd
 
HANDLE hAppHeap
 
HKEY hAppSettingsKey
 

Macro Definition Documentation

◆ _countof

#define _countof (   array)    (sizeof(array) / sizeof(array[0]))

Definition at line 68 of file sndvol32.h.

◆ ADVANCED_BUTTON_HEIGHT

#define ADVANCED_BUTTON_HEIGHT   16

Definition at line 32 of file sndvol32.h.

◆ BALANCE_CENTER

#define BALANCE_CENTER   32

Definition at line 23 of file sndvol32.h.

◆ BALANCE_LEFT

#define BALANCE_LEFT   0

Definition at line 22 of file sndvol32.h.

◆ BALANCE_PAGE_SIZE

#define BALANCE_PAGE_SIZE   12

Definition at line 27 of file sndvol32.h.

◆ BALANCE_RIGHT

#define BALANCE_RIGHT   64

Definition at line 24 of file sndvol32.h.

◆ BALANCE_STEPS

#define BALANCE_STEPS   64

Definition at line 25 of file sndvol32.h.

◆ BALANCE_TICKS

#define BALANCE_TICKS   1

Definition at line 26 of file sndvol32.h.

◆ DPRINT

#define DPRINT   DbgPrint("SNDVOL32: %s:%i: ", __FILE__, __LINE__); DbgPrint

Definition at line 71 of file sndvol32.h.

◆ PLAY_MIXER

#define PLAY_MIXER   0

Definition at line 29 of file sndvol32.h.

◆ RECORD_MIXER

#define RECORD_MIXER   1

Definition at line 30 of file sndvol32.h.

◆ SZ_APP_CLASS

#define SZ_APP_CLASS   TEXT("Volume Control")

Definition at line 67 of file sndvol32.h.

◆ VOLUME_MAX

#define VOLUME_MAX   500

Definition at line 19 of file sndvol32.h.

◆ VOLUME_MIN

#define VOLUME_MIN   0

Definition at line 18 of file sndvol32.h.

◆ VOLUME_PAGE_SIZE

#define VOLUME_PAGE_SIZE   100

Definition at line 21 of file sndvol32.h.

◆ VOLUME_TICKS

#define VOLUME_TICKS   5

Definition at line 20 of file sndvol32.h.

Typedef Documentation

◆ ADVANCED_CONTEXT

◆ MIXER_WINDOW

◆ PADVANCED_CONTEXT

◆ PFNSNDMIXENUMCONNECTIONS

typedef BOOL(CALLBACK * PFNSNDMIXENUMCONNECTIONS) (PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)

Definition at line 148 of file sndvol32.h.

◆ PFNSNDMIXENUMLINES

typedef BOOL(CALLBACK * PFNSNDMIXENUMLINES) (PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context)

Definition at line 147 of file sndvol32.h.

◆ PFNSNDMIXENUMPRODUCTS

typedef BOOL(CALLBACK * PFNSNDMIXENUMPRODUCTS) (PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context)

Definition at line 149 of file sndvol32.h.

◆ PMIXER_WINDOW

◆ PPREFERENCES_CONTEXT

◆ PREFERENCES_CONTEXT

◆ PSET_VOLUME_CONTEXT

◆ PSND_MIXER

◆ PSND_MIXER_CONNECTION

◆ PSND_MIXER_DESTINATION

◆ PSNDVOL_REG_LINESTATE

◆ PWINDOW_MODE

◆ SET_VOLUME_CONTEXT

◆ SND_MIXER

◆ SND_MIXER_CONNECTION

◆ SND_MIXER_DESTINATION

◆ SNDVOL_REG_LINESTATE

◆ WINDOW_MODE

Enumeration Type Documentation

◆ _WINDOW_MODE

Enumerator
NORMAL_MODE 
SMALL_MODE 
TRAY_MODE 

Definition at line 34 of file sndvol32.h.

35{
enum _WINDOW_MODE WINDOW_MODE
enum _WINDOW_MODE * PWINDOW_MODE
@ SMALL_MODE
Definition: sndvol32.h:37
@ NORMAL_MODE
Definition: sndvol32.h:36
@ TRAY_MODE
Definition: sndvol32.h:38

Function Documentation

◆ AdvancedDlgProc()

INT_PTR CALLBACK AdvancedDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 225 of file advanced.c.

230{
232
234
235 switch (uMsg)
236 {
237 case WM_INITDIALOG:
239 if (pData != NULL)
240 {
242 pData->Context = (PADVANCED_CONTEXT)((LONG_PTR)lParam);
243 OnInitDialog(hwndDlg, pData);
244 }
245 return TRUE;
246
247 case WM_COMMAND:
248 switch (LOWORD(wParam))
249 {
250 case IDOK:
251 EndDialog(hwndDlg, IDOK);
252 break;
253 }
254 break;
255
256 case WM_HSCROLL:
257 if (pData != NULL)
258 {
261 }
262 break;
263
264 case WM_CLOSE:
265 EndDialog(hwndDlg, IDCANCEL);
266 break;
267
268 case WM_DESTROY:
269 if (pData != NULL)
270 {
273 }
274 break;
275 }
276
277 return FALSE;
278}
struct _ADVANCED_DATA * PADVANCED_DATA
static VOID OnHScroll(HWND hwndDlg, PADVANCED_DATA pData, DWORD dwCtrlID)
Definition: advanced.c:182
static VOID OnInitDialog(HWND hwndDlg, PADVANCED_DATA pData)
Definition: advanced.c:25
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define LOWORD(l)
Definition: pedump.c:82
#define TB_THUMBTRACK
Definition: commctrl.h:2078
struct _ADVANCED_CONTEXT * PADVANCED_CONTEXT
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define WM_CLOSE
Definition: winuser.h:1611
#define DWLP_USER
Definition: winuser.h:866
#define WM_HSCROLL
Definition: winuser.h:1733
#define IDCANCEL
Definition: winuser.h:825
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
int WINAPI GetDlgCtrlID(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1599
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

◆ AllocAndLoadString()

INT AllocAndLoadString ( OUT LPWSTR lpTarget,
IN HINSTANCE  hInst,
IN UINT  uID 
)

Definition at line 50 of file misc.c.

53{
54 INT ln;
55
57 uID);
58 if (ln++ > 0)
59 {
60 (*lpTarget) = (LPWSTR)LocalAlloc(LMEM_FIXED,
61 ln * sizeof(WCHAR));
62 if ((*lpTarget) != NULL)
63 {
64 INT Ret;
65 if (!(Ret = LoadStringW(hInst, uID, *lpTarget, ln)))
66 {
67 LocalFree((HLOCAL)(*lpTarget));
68 }
69 return Ret;
70 }
71 }
72 return 0;
73}
static INT LengthOfStrResource(IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:14
HINSTANCE hInst
Definition: dxdiag.c:13
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
int32_t INT
Definition: typedefs.h:58
#define LMEM_FIXED
Definition: winbase.h:368
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ CloseAppConfig()

VOID CloseAppConfig ( VOID  )

Definition at line 152 of file misc.c.

153{
154 if (hAppSettingsKey != NULL)
155 {
158 }
159}
HKEY hAppSettingsKey
Definition: misc.c:135
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by _tWinMain().

◆ DbgPrint()

ULONG DbgPrint ( PCH  ,
  ... 
)

◆ GetStyleValue()

DWORD GetStyleValue ( VOID  )

Definition at line 388 of file misc.c.

389{
390 HKEY hOptionsKey;
391 DWORD dwStyle = 0, dwSize;
392
395 0,
396 KEY_READ,
397 &hOptionsKey) == ERROR_SUCCESS)
398 {
399 dwSize = sizeof(DWORD);
400 RegQueryValueEx(hOptionsKey,
402 NULL,
403 NULL,
404 (LPBYTE)&dwStyle,
405 &dwSize);
406
407 RegCloseKey(hOptionsKey);
408 }
409
410 return dwStyle;
411}
static const TCHAR StyleValue[]
Definition: misc.c:133
static const TCHAR AppOptionsKey[]
Definition: misc.c:131
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned long DWORD
Definition: ntddk_ex.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1023
#define DWORD
Definition: nt_native.h:44
unsigned char * LPBYTE
Definition: typedefs.h:53
#define RegOpenKeyEx
Definition: winreg.h:520
#define RegQueryValueEx
Definition: winreg.h:524

Referenced by _tWinMain().

◆ InitAppConfig()

BOOL InitAppConfig ( VOID  )

Definition at line 138 of file misc.c.

139{
142 0,
143 NULL,
146 NULL,
149}
static const TCHAR AppRegSettings[]
Definition: misc.c:130
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegCreateKeyEx
Definition: winreg.h:501

Referenced by _tWinMain().

◆ LoadAndFormatString()

DWORD LoadAndFormatString ( IN HINSTANCE  hInstance,
IN UINT  uID,
OUT LPWSTR lpTarget,
  ... 
)

Definition at line 76 of file misc.c.

80{
81 DWORD Ret = 0;
83 va_list lArgs;
84
87 uID) > 0)
88 {
89 va_start(lArgs, lpTarget);
90 /* let's use Format to format it because it has the ability to allocate
91 memory automatically */
94 0,
95 0,
96 (LPWSTR)lpTarget,
97 0,
98 &lArgs);
99 va_end(lArgs);
100
102 }
103
104 return Ret;
105}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
HINSTANCE hInstance
Definition: charmap.c:19
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
LPCWSTR lpFormat
Definition: trayclock.cpp:32
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:421
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419

◆ LoadDialogCtrls()

VOID LoadDialogCtrls ( PPREFERENCES_CONTEXT  PrefContext)

Definition at line 676 of file dialog.c.

678{
679 WCHAR szBuffer[64];
680 HWND hDlgCtrl;
681 RECT statusRect;
682 UINT i;
683 LONG dy;
684
685 /* set dialog count to zero */
686 PrefContext->MixerWindow->DialogCount = 0;
687 PrefContext->MixerWindow->bHasExtendedControls = FALSE;
688 SetRectEmpty(&PrefContext->MixerWindow->rect);
689
690 /* enumerate controls */
691 SndMixerEnumConnections(PrefContext->MixerWindow->Mixer, PrefContext->SelectedLine, EnumConnectionsCallback, (PVOID)PrefContext);
692
693 /* Update the 'Advanced Controls' menu item */
694 EnableMenuItem(GetMenu(PrefContext->MixerWindow->hWnd),
697
698 /* Add some height for the status bar */
699 if (PrefContext->MixerWindow->hStatusBar)
700 {
701 GetWindowRect(PrefContext->MixerWindow->hStatusBar, &statusRect);
702 PrefContext->MixerWindow->rect.bottom += (statusRect.bottom - statusRect.top);
703 }
704
705 /* Add height of the 'Advanced' button */
707 if (PrefContext->MixerWindow->bShowExtendedControls && PrefContext->MixerWindow->bHasExtendedControls)
708 PrefContext->MixerWindow->rect.bottom += dy;
709
710 /* now move the window */
712 SetWindowPos(PrefContext->MixerWindow->hWnd, HWND_TOP, PrefContext->MixerWindow->rect.left, PrefContext->MixerWindow->rect.top, PrefContext->MixerWindow->rect.right - PrefContext->MixerWindow->rect.left, PrefContext->MixerWindow->rect.bottom - PrefContext->MixerWindow->rect.top, SWP_NOMOVE | SWP_NOZORDER);
713
714 /* Move the status bar */
715 if (PrefContext->MixerWindow->hStatusBar)
716 {
717 SetWindowPos(PrefContext->MixerWindow->hStatusBar,
718 HWND_TOP,
719 statusRect.left,
720 PrefContext->MixerWindow->rect.bottom - (statusRect.bottom - statusRect.top),
721 PrefContext->MixerWindow->rect.right - PrefContext->MixerWindow->rect.left,
722 statusRect.bottom - statusRect.top,
724 }
725
726 if (PrefContext->MixerWindow->MixerId == RECORD_MIXER)
727 LoadStringW(hAppInstance, IDS_SELECT, szBuffer, ARRAYSIZE(szBuffer));
728
729 for (i = 0; i < PrefContext->MixerWindow->DialogCount; i++)
730 {
731 if (PrefContext->MixerWindow->MixerId == RECORD_MIXER)
732 {
733 hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, (i + 1) * IDC_LINE_SWITCH);
734
735 /* Turn the autocheckbox into a checkbox */
737
738 /* Change text from 'Mute' to 'Select' */
739 SetWindowTextW(hDlgCtrl, szBuffer);
740 }
741
742 /* Resize the vertical line separator */
743 hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, (i + 1) * IDC_LINE_SEP);
744 if (hDlgCtrl != NULL)
745 {
746 GetWindowRect(hDlgCtrl, &statusRect);
747 if (PrefContext->MixerWindow->bShowExtendedControls && PrefContext->MixerWindow->bHasExtendedControls)
748 statusRect.bottom += dy;
749
750 SetWindowPos(hDlgCtrl,
751 HWND_TOP,
752 0,
753 0,
754 statusRect.right - statusRect.left,
755 statusRect.bottom - statusRect.top,
757 }
758 }
759
760 /* Hide the last line separator */
761 hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, IDC_LINE_SEP * PrefContext->MixerWindow->DialogCount);
762 if (hDlgCtrl != NULL)
763 {
764 ShowWindow(hDlgCtrl, SW_HIDE);
765 }
766}
HINSTANCE hAppInstance
Definition: mmc.c:23
BOOL CALLBACK EnumConnectionsCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
Definition: dialog.c:447
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
Definition: mixer.c:552
#define IDS_SELECT
Definition: resources.h:43
#define IDM_ADVANCED_CONTROLS
Definition: resources.h:10
#define IDC_LINE_SWITCH
Definition: resources.h:23
#define IDC_LINE_SEP
Definition: resources.h:27
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
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
GLint dy
Definition: linetemp.h:97
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
unsigned int UINT
Definition: ndis.h:50
#define WS_CAPTION
Definition: pedump.c:624
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_VISIBLE
Definition: pedump.c:620
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
long LONG
Definition: pedump.c:60
#define BS_CHECKBOX
Definition: pedump.c:653
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define RECORD_MIXER
Definition: sndvol32.h:30
#define ADVANCED_BUTTON_HEIGHT
Definition: sndvol32.h:32
BOOL bShowExtendedControls
Definition: sndvol32.h:54
struct _SND_MIXER * Mixer
Definition: sndvol32.h:45
UINT MixerId
Definition: sndvol32.h:52
UINT DialogCount
Definition: sndvol32.h:49
HWND hStatusBar
Definition: sndvol32.h:44
BOOL bHasExtendedControls
Definition: sndvol32.h:53
SIZE baseUnit
Definition: sndvol32.h:57
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:108
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG cy
Definition: windef.h:335
#define SW_HIDE
Definition: winuser.h:762
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1234
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define HWND_TOP
Definition: winuser.h:1197
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define SWP_NOZORDER
Definition: winuser.h:1237
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetMenu(_In_ HWND)
#define MF_GRAYED
Definition: winuser.h:129

Referenced by RebuildMixerWindowControls().

◆ LoadXYCoordWnd()

BOOL LoadXYCoordWnd ( IN PPREFERENCES_CONTEXT  PrefContext)

Definition at line 162 of file misc.c.

163{
164 HKEY hKey;
165 LONG lResult;
166 TCHAR DeviceMixerSettings[256];
168 DWORD cbData = sizeof(dwData);
169
170 /* Append the registry key path and device name key into one single string */
171 StringCchPrintf(DeviceMixerSettings, _countof(DeviceMixerSettings), TEXT("%s\\%s"), AppRegSettings, PrefContext->DeviceName);
172
174 DeviceMixerSettings,
175 0,
176 KEY_READ,
177 &hKey);
178 if (lResult != ERROR_SUCCESS)
179 {
180 return FALSE;
181 }
182
183 lResult = RegQueryValueEx(hKey,
184 TEXT("X"),
185 0,
186 0,
187 (LPBYTE)&dwData,
188 &cbData);
189 if (lResult != ERROR_SUCCESS)
190 {
192 return FALSE;
193 }
194
195 /* Cache the X coordinate point */
196 PrefContext->MixerWindow->WndPosX = dwData;
197
198 lResult = RegQueryValueEx(hKey,
199 TEXT("Y"),
200 0,
201 0,
202 (LPBYTE)&dwData,
203 &cbData);
204 if (lResult != ERROR_SUCCESS)
205 {
207 return FALSE;
208 }
209
210 /* Cache the Y coordinate point */
211 PrefContext->MixerWindow->WndPosY = dwData;
212
214 return TRUE;
215}
FxAutoRegKey hKey
#define TEXT(s)
Definition: k32.h:26
static HANDLE ULONG_PTR dwData
Definition: file.c:35
#define _countof(array)
Definition: sndvol32.h:68
#define StringCchPrintf
Definition: strsafe.h:517
char TCHAR
Definition: xmlstorage.h:189

Referenced by MainWindowProc().

◆ ReadLineConfig()

BOOL ReadLineConfig ( IN LPTSTR  szDeviceName,
IN LPTSTR  szLineName,
IN LPTSTR  szControlName,
OUT DWORD Flags 
)

Definition at line 307 of file misc.c.

311{
312 HKEY hLineKey;
313 DWORD Type;
314 DWORD i, Size = 0;
315 PSNDVOL_REG_LINESTATE LineStates = NULL;
316 TCHAR szDevRegKey[MAX_PATH];
317 BOOL Ret = FALSE;
318
319 _stprintf(szDevRegKey,
320 TEXT("%s\\%s"),
322 szLineName);
323
325 szDevRegKey,
326 0,
327 NULL,
330 NULL,
331 &hLineKey,
333 {
334 if (RegQueryValueEx(hLineKey,
336 NULL,
337 &Type,
338 NULL,
339 &Size) != ERROR_SUCCESS ||
340 Type != REG_BINARY ||
341 Size == 0 || (Size % sizeof(SNDVOL_REG_LINESTATE) != 0))
342 {
343 goto ExitClose;
344 }
345
346 LineStates = HeapAlloc(GetProcessHeap(),
348 Size);
349
350 if (LineStates != NULL)
351 {
352 if (RegQueryValueEx(hLineKey,
354 NULL,
355 &Type,
356 (LPBYTE)LineStates,
357 &Size) != ERROR_SUCCESS ||
358 Type != REG_BINARY ||
359 Size == 0 || (Size % sizeof(SNDVOL_REG_LINESTATE) != 0))
360 {
361 goto ExitClose;
362 }
363
364 /* try to find the control */
365 for (i = 0; i < Size / sizeof(SNDVOL_REG_LINESTATE); i++)
366 {
367 if (!_tcscmp(szControlName,
368 LineStates[i].LineName))
369 {
370 *Flags = LineStates[i].Flags;
371 Ret = TRUE;
372 break;
373 }
374 }
375 }
376
377ExitClose:
379 0,
380 LineStates);
381 RegCloseKey(hLineKey);
382 }
383
384 return Ret;
385}
Type
Definition: Type.h:7
static const TCHAR LineStatesValue[]
Definition: misc.c:132
static const WCHAR szDeviceName[]
Definition: provider.c:56
#define MAX_PATH
Definition: compat.h:34
unsigned int BOOL
Definition: ntddk_ex.h:94
#define _tcscmp
Definition: tchar.h:1424
#define _stprintf
Definition: utility.h:124
#define REG_BINARY
Definition: nt_native.h:1496
struct _SNDVOL_REG_LINESTATE SNDVOL_REG_LINESTATE
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by EnumConnectionsCallback(), and PrefDlgAddConnection().

◆ SaveXYCoordWnd()

BOOL SaveXYCoordWnd ( IN HWND  hWnd,
IN PPREFERENCES_CONTEXT  PrefContext 
)

Definition at line 218 of file misc.c.

220{
221 HKEY hKey;
222 LONG lResult;
223 TCHAR DeviceMixerSettings[256];
225
226 /* Get the placement coordinate data from the window */
227 wp.length = sizeof(WINDOWPLACEMENT);
229
230 /* Append the registry key path and device name key into one single string */
231 StringCchPrintf(DeviceMixerSettings, _countof(DeviceMixerSettings), TEXT("%s\\%s"), AppRegSettings, PrefContext->DeviceName);
232
234 DeviceMixerSettings,
235 0,
237 &hKey);
238 if (lResult != ERROR_SUCCESS)
239 {
240 return FALSE;
241 }
242
243 lResult = RegSetValueEx(hKey,
244 TEXT("X"),
245 0,
246 REG_DWORD,
248 sizeof(wp.rcNormalPosition.left));
249 if (lResult != ERROR_SUCCESS)
250 {
252 return FALSE;
253 }
254
255 lResult = RegSetValueEx(hKey,
256 TEXT("Y"),
257 0,
258 REG_DWORD,
260 sizeof(wp.rcNormalPosition.top));
261 if (lResult != ERROR_SUCCESS)
262 {
264 return FALSE;
265 }
266
268 return TRUE;
269}
HWND hWnd
Definition: settings.c:17
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define REG_DWORD
Definition: sdbapi.c:596
RECT rcNormalPosition
Definition: winuser.h:3285
#define RegSetValueEx
Definition: winreg.h:533
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
struct _WINDOWPLACEMENT WINDOWPLACEMENT

Referenced by MainWindowProc().

◆ SndMixerClose()

VOID SndMixerClose ( PSND_MIXER  Mixer)

Definition at line 101 of file mixer.c.

102{
103 if (Mixer->hmx != NULL)
104 {
105 mixerClose(Mixer->hmx);
106 Mixer->hmx = NULL;
107 Mixer->MixerId = NO_MIXER_SELECTED;
108 }
109}
#define NO_MIXER_SELECTED
Definition: mixer.c:28
UINT MixerId
Definition: sndvol32.h:100
HMIXER hmx
Definition: sndvol32.h:101
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389

Referenced by SndMixerDestroy(), and SndMixerSelect().

◆ SndMixerCreate()

PSND_MIXER SndMixerCreate ( HWND  hWndNotification,
UINT  MixerId 
)

Definition at line 69 of file mixer.c.

70{
73 sizeof(SND_MIXER));
74 if (Mixer != NULL)
75 {
76 Mixer->hWndNotification = hWndNotification;
79
80 if (Mixer->MixersCount > 0)
81 {
82 /* select the first mixer by default */
83 SndMixerSelect(Mixer, MixerId);
84 }
85 }
86
87 return Mixer;
88}
BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId)
Definition: mixer.c:304
struct _SND_MIXER SND_MIXER
struct _SND_MIXER * PSND_MIXER
UINT MixersCount
Definition: sndvol32.h:98
HWND hWndNotification
Definition: sndvol32.h:99
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283

Referenced by DlgPreferencesProc(), and MainWindowProc().

◆ SndMixerDestroy()

VOID SndMixerDestroy ( PSND_MIXER  Mixer)

Definition at line 91 of file mixer.c.

92{
93 ClearMixerCache(Mixer);
94 SndMixerClose(Mixer);
96 0,
97 Mixer);
98}
static VOID ClearMixerCache(PSND_MIXER Mixer)
Definition: mixer.c:31
VOID SndMixerClose(PSND_MIXER Mixer)
Definition: mixer.c:101

Referenced by MainWindowProc().

◆ SndMixerEnumConnections()

BOOL SndMixerEnumConnections ( PSND_MIXER  Mixer,
DWORD  LineID,
PFNSNDMIXENUMCONNECTIONS  EnumProc,
PVOID  Context 
)

Definition at line 552 of file mixer.c.

556{
557 if (Mixer->hmx)
558 {
560
561 for (Line = Mixer->Lines; Line != NULL; Line = Line->Next)
562 {
563 if (Line->Info.dwLineID == LineID)
564 {
565 PSND_MIXER_CONNECTION Connection;
566
567 if (Line->DisplayControls != 0)
568 {
569 if (!EnumProc(Mixer,
570 LineID,
571 &Line->Info,
572 Context))
573 {
574 return FALSE;
575 }
576 }
577
578 for (Connection = Line->Connections; Connection != NULL; Connection = Connection->Next)
579 {
580 if (!EnumProc(Mixer,
581 LineID,
582 &Connection->Info,
583 Context))
584 {
585 return FALSE;
586 }
587 }
588
589 return TRUE;
590 }
591 }
592 }
593
594 return FALSE;
595}
BOOL CALLBACK EnumProc(_In_ HWND hwnd, _In_ LPARAM lParam)
Definition: ncftp.h:79
struct _SND_MIXER_CONNECTION * Next
Definition: sndvol32.h:80
PSND_MIXER_DESTINATION Lines
Definition: sndvol32.h:103

Referenced by LoadDialogCtrls(), MainWindowProc(), and UpdatePrefDlgControls().

◆ SndMixerEnumLines()

BOOL SndMixerEnumLines ( PSND_MIXER  Mixer,
PFNSNDMIXENUMLINES  EnumProc,
PVOID  Context 
)

Definition at line 526 of file mixer.c.

529{
530 if (Mixer->hmx)
531 {
533
534 for (Line = Mixer->Lines; Line != NULL; Line = Line->Next)
535 {
536 if (!EnumProc(Mixer,
537 &Line->Info,
538 Line->DisplayControls,
539 Context))
540 {
541 return FALSE;
542 }
543 }
544
545 return TRUE;
546 }
547
548 return FALSE;
549}

Referenced by UpdatePrefDlgControls().

◆ SndMixerEnumProducts()

BOOL SndMixerEnumProducts ( PSND_MIXER  Mixer,
PFNSNDMIXENUMPRODUCTS  EnumProc,
PVOID  Context 
)

Definition at line 431 of file mixer.c.

434{
435 MIXERCAPS Caps;
436 HMIXER hMixer;
437 UINT i;
438 BOOL Ret = TRUE;
439
440 for (i = 0; i < Mixer->MixersCount; i++)
441 {
442 if (mixerOpen(&hMixer,
443 i,
444 0,
445 0,
446 0) == MMSYSERR_NOERROR)
447 {
448 if (mixerGetDevCaps(i,
449 &Caps,
450 sizeof(Caps)) == MMSYSERR_NOERROR)
451 {
452 if (!EnumProc(Mixer,
453 i,
454 Caps.szPname,
455 Context))
456 {
458 Ret = FALSE;
459 break;
460 }
461 }
462 else
463 {
464 DPRINT("Failed to get device capabilities for mixer id %d!\n", i);
465 }
467 }
468 }
469
470 return Ret;
471}
#define mixerGetDevCaps
Definition: mmsystem.h:2852
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
HMIXER hMixer
Definition: test.c:10
#define DPRINT
Definition: sndvol32.h:71
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342

Referenced by DlgPreferencesProc().

◆ SndMixerGetDestinationCount()

INT SndMixerGetDestinationCount ( PSND_MIXER  Mixer)

Definition at line 520 of file mixer.c.

521{
522 return (Mixer->hmx ? (INT)Mixer->Caps.cDestinations : -1);
523}
MIXERCAPS Caps
Definition: sndvol32.h:102
DWORD cDestinations
Definition: mmsystem.h:1219

◆ SndMixerGetLineByName()

LPMIXERLINE SndMixerGetLineByName ( PSND_MIXER  Mixer,
DWORD  LineID,
LPWSTR  LineName 
)

Definition at line 615 of file mixer.c.

618{
620 PSND_MIXER_CONNECTION Connection;
621
622 if (Mixer->hmx == 0)
623 return NULL;
624
625 for (Line = Mixer->Lines; Line != NULL; Line = Line->Next)
626 {
627 if (Line->Info.dwLineID == LineID)
628 {
629 if (Line->DisplayControls != 0)
630 {
631 if (wcsicmp(Line->Info.szName, LineName) == 0)
632 {
633 return &Line->Info;
634 }
635 }
636
637 for (Connection = Line->Connections; Connection != NULL; Connection = Connection->Next)
638 {
639 if (wcsicmp(Connection->Info.szName, LineName) == 0)
640 {
641 return &Connection->Info;
642 }
643 }
644
645 return NULL;
646 }
647 }
648
649 return NULL;
650}
#define wcsicmp
Definition: compat.h:15
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243

Referenced by MainWindowProc().

◆ SndMixerGetLineName()

INT SndMixerGetLineName ( PSND_MIXER  Mixer,
DWORD  LineID,
LPTSTR  lpBuffer,
UINT  uSize,
BOOL  LongName 
)

Definition at line 390 of file mixer.c.

395{
396 if (Mixer->hmx)
397 {
398 UINT lnsz;
400 LPMIXERLINE lpl = NULL;
401
402 for (Line = Mixer->Lines; Line != NULL; Line = Line->Next)
403 {
404 if (Line->Info.dwLineID == LineID)
405 {
406 lpl = &Line->Info;
407 break;
408 }
409 }
410
411 if (lpl != NULL)
412 {
413 lnsz = (UINT) lstrlen(LongName ? lpl->szName : lpl->szShortName);
414 if(lnsz + 1 > uSize)
415 {
416 return lnsz + 1;
417 }
418 else
419 {
420 memcpy(lpBuffer, LongName ? lpl->szName : lpl->szShortName, lnsz * sizeof(TCHAR));
421 lpBuffer[lnsz] = _T('\0');
422 return lnsz;
423 }
424 }
425 }
426
427 return -1;
428}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
_In_ ULONGLONG _In_ PUNICODE_STRING _In_ PUNICODE_STRING LongName
Definition: fsrtlfuncs.h:338
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
#define _T(x)
Definition: vfdio.h:22
#define lstrlen
Definition: winbase.h:3747

Referenced by EnumConnectionsCallback(), PrefDlgAddConnection(), and WriteLineSettings().

◆ SndMixerGetProductName()

INT SndMixerGetProductName ( PSND_MIXER  Mixer,
LPTSTR  lpBuffer,
UINT  uSize 
)

Definition at line 367 of file mixer.c.

370{
371 if (Mixer->hmx)
372 {
373 UINT lnsz = (UINT) lstrlen(Mixer->Caps.szPname);
374 if(lnsz + 1 > uSize)
375 {
376 return lnsz + 1;
377 }
378 else
379 {
380 memcpy(lpBuffer, Mixer->Caps.szPname, lnsz * sizeof(TCHAR));
381 lpBuffer[lnsz] = _T('\0');
382 return lnsz;
383 }
384 }
385
386 return -1;
387}

Referenced by MainWindowProc(), and UpdatePrefDlgControls().

◆ SndMixerGetSelection()

UINT SndMixerGetSelection ( PSND_MIXER  Mixer)

Definition at line 361 of file mixer.c.

362{
363 return Mixer->MixerId;
364}

Referenced by DlgPreferencesProc(), and UpdatePrefDlgControls().

◆ SndMixerGetVolumeControlDetails()

INT SndMixerGetVolumeControlDetails ( PSND_MIXER  Mixer,
DWORD  dwControlID,
DWORD  cChannels,
DWORD  cbDetails,
LPVOID  paDetails 
)

Definition at line 498 of file mixer.c.

499{
500 MIXERCONTROLDETAILS MixerDetails;
501
502 if (Mixer->hmx)
503 {
504 MixerDetails.cbStruct = sizeof(MIXERCONTROLDETAILS);
505 MixerDetails.dwControlID = dwControlID;
506 MixerDetails.cChannels = cChannels;
507 MixerDetails.cMultipleItems = 0;
508 MixerDetails.cbDetails = cbDetails;
509 MixerDetails.paDetails = paDetails;
510
512 {
513 return 1;
514 }
515 }
516 return -1;
517}
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define mixerGetControlDetails
Definition: mmsystem.h:2855
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301

Referenced by EnumConnectionsCallback(), MixerControlChangeCallback(), OnInitDialog(), and SetVolumeCallback().

◆ SndMixerIsDisplayControl()

BOOL SndMixerIsDisplayControl ( PSND_MIXER  Mixer,
LPMIXERCONTROL  Control 
)

Definition at line 598 of file mixer.c.

600{
601 if (Mixer->hmx && !(Control->fdwControl & MIXERCONTROL_CONTROLF_DISABLED))
602 {
603 switch (Control->dwControlType & MIXERCONTROL_CT_CLASS_MASK)
604 {
607 return TRUE;
608 }
609 }
610
611 return FALSE;
612}
#define MIXERCONTROL_CONTROLF_DISABLED
Definition: mmsystem.h:352
#define MIXERCONTROL_CT_CLASS_MASK
Definition: mmsystem.h:353
#define MIXERCONTROL_CT_CLASS_FADER
Definition: mmsystem.h:359
#define MIXERCONTROL_CT_CLASS_SWITCH
Definition: mmsystem.h:356
_In_ WDF_WMI_PROVIDER_CONTROL Control
Definition: wdfwmi.h:166

Referenced by SndMixerQueryControls().

◆ SndMixerQueryControls()

BOOL SndMixerQueryControls ( PSND_MIXER  Mixer,
PUINT  DisplayControls,
LPMIXERLINE  LineInfo,
LPMIXERCONTROL Controls 
)

Definition at line 112 of file mixer.c.

116{
117 if (LineInfo->cControls > 0)
118 {
119 *Controls = (MIXERCONTROL*) HeapAlloc(GetProcessHeap(),
121 LineInfo->cControls * sizeof(MIXERCONTROL));
122 if (*Controls != NULL)
123 {
124 MIXERLINECONTROLS LineControls;
126 UINT j;
127
128 LineControls.cbStruct = sizeof(LineControls);
129 LineControls.dwLineID = LineInfo->dwLineID;
130 LineControls.cControls = LineInfo->cControls;
131 LineControls.cbmxctrl = sizeof(MIXERCONTROL);
132 LineControls.pamxctrl = (MIXERCONTROL*)(*Controls);
133
134 Result = mixerGetLineControls((HMIXEROBJ)Mixer->hmx,
135 &LineControls,
138 {
139 for (j = 0; j < LineControls.cControls; j++)
140 {
141 if (SndMixerIsDisplayControl(Mixer,
142 &(*Controls)[j]))
143 {
144 (*DisplayControls)++;
145 }
146
147 DPRINT("Line control: %ws (0x%x, 0x%x)\n", (*Controls)[j].szName, (*Controls)[j].fdwControl, (*Controls)[j].dwControlType);
148 }
149
150 return TRUE;
151 }
152 else
153 {
155 0,
156 *Controls);
157 *Controls = NULL;
158 DPRINT("Failed to get line (ID: 0x%x) controls: %d\n", LineInfo->dwLineID, Result);
159 }
160 }
161 else
162 {
163 DPRINT("Failed to allocate memory for %d line (ID: 0x%x) controls!\n", LineInfo->dwLineID, LineInfo->cControls);
164 }
165
166 return FALSE;
167 }
168 else
169 {
170 return TRUE;
171 }
172}
BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control)
Definition: mixer.c:598
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 GLint GLint j
Definition: glfuncs.h:250
MIXERCONTROLA MIXERCONTROL
Definition: mmsystem.h:2825
UINT MMRESULT
Definition: mmsystem.h:962
#define mixerGetLineControls
Definition: mmsystem.h:2854
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
static const WCHAR szName[]
Definition: powrprof.c:45
DWORD cControls
Definition: mmsystem.h:1241
DWORD dwLineID
Definition: mmsystem.h:1235
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
_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
Definition: wsk.h:426

Referenced by EnumConnectionsCallback(), MixerControlChangeCallback(), OnInitDialog(), SetVolumeCallback(), SndMixerQueryConnections(), and SndMixerQueryDestinations().

◆ SndMixerSelect()

BOOL SndMixerSelect ( PSND_MIXER  Mixer,
UINT  MixerId 
)

Definition at line 304 of file mixer.c.

306{
307 if (MixerId >= Mixer->MixersCount)
308 {
309 return FALSE;
310 }
311
312 SndMixerClose(Mixer);
313
314 if (mixerOpen(&Mixer->hmx,
315 MixerId,
317 0,
319 mixerOpen(&Mixer->hmx,
320 MixerId,
322 0,
324 mixerOpen(&Mixer->hmx,
325 MixerId,
326 0,
327 0,
328 0) == MMSYSERR_NOERROR)
329 {
330 if (mixerGetDevCaps(MixerId,
331 &Mixer->Caps,
332 sizeof(Mixer->Caps)) == MMSYSERR_NOERROR)
333 {
334 BOOL Ret = FALSE;
335
336 Mixer->MixerId = MixerId;
337
338 ClearMixerCache(Mixer);
339
340 Ret = SndMixerQueryDestinations(Mixer);
341
342 if (!Ret)
343 {
344 ClearMixerCache(Mixer);
345 }
346
347 return Ret;
348 }
349 else
350 {
351 mixerClose(Mixer->hmx);
352 }
353 }
354
355 Mixer->hmx = NULL;
356 Mixer->MixerId = NO_MIXER_SELECTED;
357 return FALSE;
358}
static BOOL SndMixerQueryDestinations(PSND_MIXER Mixer)
Definition: mixer.c:240
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
uint32_t DWORD_PTR
Definition: typedefs.h:65

Referenced by SndMixerCreate(), and UpdatePrefDlgControls().

◆ SndMixerSetVolumeControlDetails()

INT SndMixerSetVolumeControlDetails ( PSND_MIXER  Mixer,
DWORD  dwControlID,
DWORD  cChannels,
DWORD  cbDetails,
LPVOID  paDetails 
)

Definition at line 474 of file mixer.c.

475{
476 MIXERCONTROLDETAILS MixerDetails;
477
478 if (Mixer->hmx)
479 {
480 MixerDetails.cbStruct = sizeof(MIXERCONTROLDETAILS);
481 MixerDetails.dwControlID = dwControlID;
482 MixerDetails.cChannels = cChannels;
483 MixerDetails.cMultipleItems = 0;
484 MixerDetails.cbDetails = cbDetails;
485 MixerDetails.paDetails = paDetails;
486
488 {
489 return 1;
490 }
491 }
492
493 return -1;
494}
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684

Referenced by OnHScroll(), and SetVolumeCallback().

◆ TrayDlgProc()

INT_PTR CALLBACK TrayDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 262 of file tray.c.

267{
268 PDIALOG_DATA pDialogData;
269
270 pDialogData = (PDIALOG_DATA)GetWindowLongPtr(hwndDlg, DWLP_USER);
271
272 switch (uMsg)
273 {
274 case WM_INITDIALOG:
275 OnTrayInitDialog(hwndDlg, wParam, lParam);
276
278 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDialogData);
279
280 if (pDialogData)
281 OnTrayInitMixer(pDialogData, hwndDlg);
282 break;
283
284 case WM_COMMAND:
285 if (pDialogData)
286 OnCommand(pDialogData, hwndDlg, wParam, lParam);
287 break;
288
289 case WM_VSCROLL:
290 if (pDialogData)
291 OnVScroll(pDialogData, hwndDlg, wParam, lParam);
292 break;
293
294 case WM_DESTROY:
295 if (pDialogData)
296 {
297 if (pDialogData->volumeInitValues)
298 HeapFree(GetProcessHeap(), 0, pDialogData->volumeInitValues);
299
300 if (pDialogData->volumeCurrentValues)
301 HeapFree(GetProcessHeap(), 0, pDialogData->volumeCurrentValues);
302
303 if (pDialogData->hMixer)
304 mixerClose(pDialogData->hMixer);
305
306 HeapFree(GetProcessHeap(), 0, pDialogData);
307 pDialogData = NULL;
309 }
310 break;
311
312 case WM_ACTIVATE:
313 if (LOWORD(wParam) == WA_INACTIVE)
314 EndDialog(hwndDlg, IDOK);
315 break;
316 }
317
318 return 0;
319}
PMIXERCONTROLDETAILS_UNSIGNED volumeCurrentValues
Definition: tray.c:22
PMIXERCONTROLDETAILS_UNSIGNED volumeInitValues
Definition: tray.c:21
HMIXER hMixer
Definition: tray.c:12
static VOID OnCommand(PDIALOG_DATA pDialogData, HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: tray.c:173
static VOID OnTrayInitMixer(PDIALOG_DATA pDialogData, HWND hwndDlg)
Definition: tray.c:64
struct _DIALOG_DATA DIALOG_DATA
static VOID OnTrayInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: tray.c:29
struct _DIALOG_DATA * PDIALOG_DATA
static VOID OnVScroll(PDIALOG_DATA pDialogData, HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: tray.c:203
#define WM_VSCROLL
Definition: winuser.h:1734
#define WA_INACTIVE
Definition: winuser.h:2612
#define WM_ACTIVATE
Definition: winuser.h:1602

Referenced by _tWinMain().

◆ UpdateDialogLineSliderControl()

VOID UpdateDialogLineSliderControl ( PPREFERENCES_CONTEXT  PrefContext,
LPMIXERLINE  Line,
DWORD  DialogID,
DWORD  Position 
)

Definition at line 815 of file dialog.c.

820{
821 DWORD Index;
822 DWORD wID;
823 HWND hDlgCtrl;
825
826 /* find the index of this line */
827 for (Index = 0; Index < PrefContext->MixerWindow->DialogCount; Index++)
828 {
829 /* get id */
830 wID = (Index + 1) * IDC_LINE_NAME;
831
832 if (GetDlgItemText(PrefContext->MixerWindow->hWnd, wID, LineName, MIXER_LONG_NAME_CHARS) == 0)
833 {
834 /* failed to retrieve id */
835 continue;
836 }
837
838 /* check if the line name matches */
839 if (!wcsicmp(LineName, Line->szName))
840 {
841 /* found matching line name */
842 wID = (Index + 1) * dwDialogID;
843
844 /* get dialog control */
845 hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
846
847 if (hDlgCtrl != NULL)
848 {
849 /* check state */
850 LRESULT OldPosition = SendMessageW(hDlgCtrl, TBM_GETPOS, 0, 0);
851 if (OldPosition != Position)
852 {
853 /* update control state */
855 }
856 }
857 break;
858 }
859 }
860}
#define IDC_LINE_NAME
Definition: resources.h:22
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
#define TBM_GETPOS
Definition: commctrl.h:2031
#define TBM_SETPOS
Definition: commctrl.h:2036
static COORD Position
Definition: mouse.c:34
_In_ WDFCOLLECTION _In_ ULONG Index
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define GetDlgItemText
Definition: winuser.h:5775
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by MixerControlChangeCallback().

◆ UpdateDialogLineSwitchControl()

VOID UpdateDialogLineSwitchControl ( PPREFERENCES_CONTEXT  PrefContext,
LPMIXERLINE  Line,
LONG  fValue 
)

Definition at line 769 of file dialog.c.

773{
774 DWORD Index;
775 DWORD wID;
776 HWND hDlgCtrl;
778
779 /* find the index of this line */
780 for (Index = 0; Index < PrefContext->MixerWindow->DialogCount; Index++)
781 {
782 /* get id */
783 wID = (Index + 1) * IDC_LINE_NAME;
784
785 if (GetDlgItemText(PrefContext->MixerWindow->hWnd, wID, LineName, MIXER_LONG_NAME_CHARS) == 0)
786 {
787 /* failed to retrieve id */
788 continue;
789 }
790
791 /* check if the line name matches */
792 if (!wcsicmp(LineName, Line->szName))
793 {
794 /* found matching line name */
795 wID = (Index + 1) * IDC_LINE_SWITCH;
796
797 /* get dialog control */
798 hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
799
800 if (hDlgCtrl != NULL)
801 {
802 /* check state */
803 if (SendMessageW(hDlgCtrl, BM_GETCHECK, 0, 0) != fValue)
804 {
805 /* update control state */
806 SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)fValue, 0);
807 }
808 }
809 break;
810 }
811 }
812}
#define BM_SETCHECK
Definition: winuser.h:1911
#define BM_GETCHECK
Definition: winuser.h:1908

Referenced by MixerControlChangeCallback().

◆ WriteLineConfig()

BOOL WriteLineConfig ( IN LPTSTR  szDeviceName,
IN LPTSTR  szLineName,
IN PSNDVOL_REG_LINESTATE  LineState,
IN DWORD  cbSize 
)

Definition at line 272 of file misc.c.

276{
277 HKEY hLineKey;
278 TCHAR szDevRegKey[MAX_PATH];
279 BOOL Ret = FALSE;
280
281 _stprintf(szDevRegKey,
282 TEXT("%s\\%s"),
284 szLineName);
285
287 szDevRegKey,
288 0,
289 NULL,
292 NULL,
293 &hLineKey,
295 {
296 /* now update line states */
297 RegSetValueEx(hLineKey, LineStatesValue, 0, REG_BINARY, (const BYTE*)LineState, cbSize);
298 Ret = TRUE;
299
300 RegCloseKey(hLineKey);
301 }
302
303 return Ret;
304}
unsigned char BYTE
Definition: xxhash.c:193

Referenced by WriteLineSettings().

Variable Documentation

◆ hAppHeap

◆ hAppInstance

HINSTANCE hAppInstance
extern

Definition at line 23 of file mmc.c.

◆ hAppSettingsKey

HKEY hAppSettingsKey
extern

Definition at line 135 of file misc.c.

Referenced by CloseAppConfig(), GetStyleValue(), InitAppConfig(), ReadLineConfig(), and WriteLineConfig().

◆ hMainWnd

HWND hMainWnd
extern

Definition at line 32 of file magnifier.c.

◆ MainWindowClass

ATOM MainWindowClass
extern

Definition at line 31 of file sndvol32.c.

Referenced by RegisterApplicationClasses().