ReactOS  0.4.12-dev-685-gf36cbf7
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 <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  _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 SZ_APP_CLASS   TEXT("Volume Control")
 
#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 _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)
 
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)
 
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

◆ BALANCE_CENTER

#define BALANCE_CENTER   32

Definition at line 22 of file sndvol32.h.

◆ BALANCE_LEFT

#define BALANCE_LEFT   0

Definition at line 21 of file sndvol32.h.

◆ BALANCE_PAGE_SIZE

#define BALANCE_PAGE_SIZE   12

Definition at line 26 of file sndvol32.h.

◆ BALANCE_RIGHT

#define BALANCE_RIGHT   64

Definition at line 23 of file sndvol32.h.

◆ BALANCE_STEPS

#define BALANCE_STEPS   64

Definition at line 24 of file sndvol32.h.

◆ BALANCE_TICKS

#define BALANCE_TICKS   1

Definition at line 25 of file sndvol32.h.

◆ DPRINT

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

Definition at line 58 of file sndvol32.h.

◆ SZ_APP_CLASS

#define SZ_APP_CLASS   TEXT("Volume Control")

Definition at line 55 of file sndvol32.h.

◆ VOLUME_MAX

#define VOLUME_MAX   500

Definition at line 18 of file sndvol32.h.

◆ VOLUME_MIN

#define VOLUME_MIN   0

Definition at line 17 of file sndvol32.h.

◆ VOLUME_PAGE_SIZE

#define VOLUME_PAGE_SIZE   100

Definition at line 20 of file sndvol32.h.

◆ VOLUME_TICKS

#define VOLUME_TICKS   5

Definition at line 19 of file sndvol32.h.

Typedef Documentation

◆ MIXER_WINDOW

◆ PFNSNDMIXENUMCONNECTIONS

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

Definition at line 127 of file sndvol32.h.

◆ PFNSNDMIXENUMLINES

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

Definition at line 126 of file sndvol32.h.

◆ PFNSNDMIXENUMPRODUCTS

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

Definition at line 128 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 28 of file sndvol32.h.

29 {
31  SMALL_MODE,
32  TRAY_MODE
enum _WINDOW_MODE WINDOW_MODE
enum _WINDOW_MODE * PWINDOW_MODE

Function Documentation

◆ 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 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
#define LMEM_FIXED
Definition: winbase.h:349
HINSTANCE hInst
Definition: dxdiag.c:13
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
static LPWSTR
Definition: misc.c:35
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373
INT LengthOfStrResource(IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:23

Referenced by LoadAndFormatString(), StatusBarLoadAndFormatString(), StatusBarLoadString(), and VarListLoadAndFormatString().

◆ 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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416

Referenced by _tWinMain().

◆ DbgPrint()

ULONG DbgPrint ( PCH  ,
  ... 
)

◆ GetStyleValue()

DWORD GetStyleValue ( VOID  )

Definition at line 278 of file misc.c.

279 {
280  HKEY hOptionsKey;
281  DWORD dwStyle = 0, dwSize;
282 
285  0,
286  KEY_READ,
287  &hOptionsKey) == ERROR_SUCCESS)
288  {
289  dwSize = sizeof(DWORD);
290  RegQueryValueEx(hOptionsKey,
291  StyleValue,
292  NULL,
293  NULL,
294  (LPBYTE)&dwStyle,
295  &dwSize);
296 
297  RegCloseKey(hOptionsKey);
298  }
299 
300  return dwStyle;
301 }
#define RegQueryValueEx
Definition: winreg.h:524
HKEY hAppSettingsKey
Definition: misc.c:135
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
static const TCHAR StyleValue[]
Definition: misc.c:133
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
static const TCHAR AppOptionsKey[]
Definition: misc.c:131
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD
Definition: misc.c:47
#define RegOpenKeyEx
Definition: winreg.h:520
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by _tWinMain().

◆ InitAppConfig()

BOOL InitAppConfig ( VOID  )

Definition at line 138 of file misc.c.

139 {
142  0,
143  NULL,
146  NULL,
148  NULL) == ERROR_SUCCESS;
149 }
HKEY hAppSettingsKey
Definition: misc.c:135
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
static const TCHAR AppRegSettings[]
Definition: misc.c:130
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
#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 
86  hInstance,
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 */
93  lpFormat,
94  0,
95  0,
96  (LPWSTR)lpTarget,
97  0,
98  &lArgs);
99  va_end(lArgs);
100 
102  }
103 
104  return Ret;
105 }
#define FORMAT_MESSAGE_FROM_STRING
Definition: winbase.h:402
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
HINSTANCE hInstance
Definition: charmap.c:20
#define va_end(ap)
Definition: acmsvcex.h:90
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
char * va_list
Definition: acmsvcex.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
LPCWSTR lpFormat
Definition: trayclock.cpp:32
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
#define va_start(ap, A)
Definition: acmsvcex.h:91
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ LoadDialogCtrls()

VOID LoadDialogCtrls ( PPREFERENCES_CONTEXT  PrefContext)

Definition at line 619 of file dialog.c.

621 {
622  HWND hDlgCtrl;
623  RECT statusRect;
624 
625  /* set dialog count to zero */
626  PrefContext->Count = 0;
627 
628  SetRectEmpty(&PrefContext->MixerWindow->rect);
629 
630  /* enumerate controls */
631  SndMixerEnumConnections(PrefContext->MixerWindow->Mixer, PrefContext->SelectedLine, EnumConnectionsCallback, (PVOID)PrefContext);
632 
633  if (PrefContext->MixerWindow->hStatusBar)
634  {
635  GetWindowRect(PrefContext->MixerWindow->hStatusBar, &statusRect);
636  PrefContext->MixerWindow->rect.bottom += (statusRect.bottom - statusRect.top);
637  }
638 
639  /* now move the window */
641  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);
642 
643  /* get last line separator */
644  hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, IDC_LINE_SEP * PrefContext->Count);
645 
646  if (hDlgCtrl != NULL)
647  {
648  /* hide last separator */
649  ShowWindow(hDlgCtrl, SW_HIDE);
650  }
651 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TRUE
Definition: types.h:120
#define SW_HIDE
Definition: winuser.h:762
LONG top
Definition: windef.h:292
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
Definition: mixer.c:552
#define WS_DLGFRAME
Definition: pedump.c:626
#define HWND_TOP
Definition: winuser.h:1193
LONG left
Definition: windef.h:291
#define SWP_NOZORDER
Definition: winuser.h:1232
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:293
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
#define IDC_LINE_SEP
Definition: resources.h:26
BOOL CALLBACK EnumConnectionsCallback(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
Definition: dialog.c:405
struct _SND_MIXER * Mixer
Definition: sndvol32.h:39
smooth NULL
Definition: ftsmooth.c:416
#define WS_CAPTION
Definition: pedump.c:624
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define WS_MINIMIZEBOX
Definition: pedump.c:631
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
LONG bottom
Definition: windef.h:294
#define SWP_NOMOVE
Definition: winuser.h:1229
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 WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
HWND hStatusBar
Definition: sndvol32.h:38
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:95

Referenced by RebuildMixerWindowControls().

◆ ReadLineConfig()

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

Definition at line 197 of file misc.c.

201 {
202  HKEY hLineKey;
203  DWORD Type;
204  DWORD i, Size = 0;
205  PSNDVOL_REG_LINESTATE LineStates = NULL;
206  TCHAR szDevRegKey[MAX_PATH];
207  BOOL Ret = FALSE;
208 
209  _stprintf(szDevRegKey,
210  TEXT("%s\\%s"),
211  szDeviceName,
212  szLineName);
213 
215  szDevRegKey,
216  0,
217  NULL,
220  NULL,
221  &hLineKey,
222  NULL) == ERROR_SUCCESS)
223  {
224  if (RegQueryValueEx(hLineKey,
226  NULL,
227  &Type,
228  NULL,
229  &Size) != ERROR_SUCCESS ||
230  Type != REG_BINARY ||
231  Size == 0 || (Size % sizeof(SNDVOL_REG_LINESTATE) != 0))
232  {
233  goto ExitClose;
234  }
235 
236  LineStates = HeapAlloc(GetProcessHeap(),
238  Size);
239 
240  if (LineStates != NULL)
241  {
242  if (RegQueryValueEx(hLineKey,
244  NULL,
245  &Type,
246  (LPBYTE)LineStates,
247  &Size) != ERROR_SUCCESS ||
248  Type != REG_BINARY ||
249  Size == 0 || (Size % sizeof(SNDVOL_REG_LINESTATE) != 0))
250  {
251  goto ExitClose;
252  }
253 
254  /* try to find the control */
255  for (i = 0; i < Size / sizeof(SNDVOL_REG_LINESTATE); i++)
256  {
257  if (!_tcscmp(szControlName,
258  LineStates[i].LineName))
259  {
260  *Flags = LineStates[i].Flags;
261  Ret = TRUE;
262  break;
263  }
264  }
265  }
266 
267 ExitClose:
269  0,
270  LineStates);
271  RegCloseKey(hLineKey);
272  }
273 
274  return Ret;
275 }
#define RegQueryValueEx
Definition: winreg.h:524
HKEY hAppSettingsKey
Definition: misc.c:135
#define TRUE
Definition: types.h:120
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
int _tcscmp(const _TCHAR *s1, const _TCHAR *s2)
Definition: tcscmp.h:8
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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
struct _SNDVOL_REG_LINESTATE SNDVOL_REG_LINESTATE
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
static const TCHAR LineStatesValue[]
Definition: misc.c:132
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
char TCHAR
Definition: xmlstorage.h:189
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR szDeviceName[]
Definition: provider.c:53
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define _stprintf
Definition: utility.h:124
#define TEXT(s)
Definition: k32.h:26
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RegCreateKeyEx
Definition: winreg.h:501

Referenced by EnumConnectionsCallback(), and PrefDlgAddConnection().

◆ 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 }
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
#define NO_MIXER_SELECTED
Definition: mixer.c:28
smooth NULL
Definition: ftsmooth.c:416
HMIXER hmx
Definition: sndvol32.h:88
UINT MixerId
Definition: sndvol32.h:87

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;
77  Mixer->MixersCount = mixerGetNumDevs();
78  Mixer->MixerId = NO_MIXER_SELECTED;
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 }
HWND hWndNotification
Definition: sndvol32.h:86
#define NO_MIXER_SELECTED
Definition: mixer.c:28
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
UINT MixerId
Definition: sndvol32.h:87
struct _SND_MIXER * PSND_MIXER
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
UINT MixersCount
Definition: sndvol32.h:85
BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId)
Definition: mixer.c:304
struct _SND_MIXER SND_MIXER

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
#define GetProcessHeap()
Definition: compat.h:395
VOID SndMixerClose(PSND_MIXER Mixer)
Definition: mixer.c:101
#define HeapFree(x, y, z)
Definition: compat.h:394

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 }
#define TRUE
Definition: types.h:120
PSND_MIXER_DESTINATION Lines
Definition: sndvol32.h:90
smooth NULL
Definition: ftsmooth.c:416
HMIXER hmx
Definition: sndvol32.h:88
Definition: ncftp.h:79
struct _SND_MIXER_CONNECTION * Next
Definition: sndvol32.h:67
static BOOL CALLBACK EnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: SetParent.c:53
struct Line Line

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 }
#define TRUE
Definition: types.h:120
PSND_MIXER_DESTINATION Lines
Definition: sndvol32.h:90
smooth NULL
Definition: ftsmooth.c:416
HMIXER hmx
Definition: sndvol32.h:88
Definition: ncftp.h:79
static BOOL CALLBACK EnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: SetParent.c:53
struct Line Line

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 TRUE
Definition: types.h:120
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
#define mixerGetDevCaps
Definition: mmsystem.h:2842
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
HMIXER hMixer
Definition: test.c:10
void DPRINT(...)
Definition: polytest.cpp:61
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
unsigned int UINT
Definition: ndis.h:50
UINT MixersCount
Definition: sndvol32.h:85
static BOOL CALLBACK EnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: SetParent.c:53

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 }
int32_t INT
Definition: typedefs.h:56
MIXERCAPS Caps
Definition: sndvol32.h:89
HMIXER hmx
Definition: sndvol32.h:88
DWORD cDestinations
Definition: mmsystem.h:1219

◆ 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 }
PSND_MIXER_DESTINATION Lines
Definition: sndvol32.h:90
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
smooth NULL
Definition: ftsmooth.c:416
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HMIXER hmx
Definition: sndvol32.h:88
unsigned int UINT
Definition: ndis.h:50
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243
Definition: ncftp.h:79
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define lstrlen
Definition: winbase.h:3690
_In_ ULONGLONG _In_ PUNICODE_STRING _In_ PUNICODE_STRING LongName
Definition: fsrtlfuncs.h:336
#define UINT
Definition: msvc.h:27
struct Line Line

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 }
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
MIXERCAPS Caps
Definition: sndvol32.h:89
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
HMIXER hmx
Definition: sndvol32.h:88
unsigned int UINT
Definition: ndis.h:50
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define lstrlen
Definition: winbase.h:3690
#define UINT
Definition: msvc.h:27

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 }
UINT MixerId
Definition: sndvol32.h:87

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 MMSYSERR_NOERROR
Definition: mmsystem.h:96
HMIXER hmx
Definition: sndvol32.h:88
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
#define mixerGetControlDetails
Definition: mmsystem.h:2845

Referenced by EnumConnectionsCallback(), MixerControlChangeCallback(), 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 TRUE
Definition: types.h:120
#define MIXERCONTROL_CT_CLASS_MASK
Definition: mmsystem.h:353
#define MIXERCONTROL_CT_CLASS_SWITCH
Definition: mmsystem.h:356
#define MIXERCONTROL_CONTROLF_DISABLED
Definition: mmsystem.h:352
HMIXER hmx
Definition: sndvol32.h:88
static const WCHAR Control[]
Definition: interface.c:27
#define MIXERCONTROL_CT_CLASS_FADER
Definition: mmsystem.h:359

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,
137  if (Result == MMSYSERR_NOERROR)
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 }
#define TRUE
Definition: types.h:120
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
#define mixerGetLineControls
Definition: mmsystem.h:2844
UINT MMRESULT
Definition: mmsystem.h:962
BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control)
Definition: mixer.c:598
MIXERCONTROLA MIXERCONTROL
Definition: mmsystem.h:2815
DWORD cControls
Definition: mmsystem.h:1241
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
smooth NULL
Definition: ftsmooth.c:416
_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
void DPRINT(...)
Definition: polytest.cpp:61
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
DWORD dwLineID
Definition: mmsystem.h:1235
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HMIXER hmx
Definition: sndvol32.h:88
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static const WCHAR szName[]
Definition: msipriv.h:1194
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by EnumConnectionsCallback(), MixerControlChangeCallback(), 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,
316  (DWORD_PTR)Mixer->hWndNotification,
317  0,
319  mixerOpen(&Mixer->hmx,
320  MixerId,
321  (DWORD_PTR)Mixer->hWndNotification,
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 }
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
static BOOL SndMixerQueryDestinations(PSND_MIXER Mixer)
Definition: mixer.c:240
#define mixerGetDevCaps
Definition: mmsystem.h:2842
static VOID ClearMixerCache(PSND_MIXER Mixer)
Definition: mixer.c:31
HWND hWndNotification
Definition: sndvol32.h:86
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
#define NO_MIXER_SELECTED
Definition: mixer.c:28
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
MIXERCAPS Caps
Definition: sndvol32.h:89
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
HMIXER hmx
Definition: sndvol32.h:88
VOID SndMixerClose(PSND_MIXER Mixer)
Definition: mixer.c:101
UINT MixerId
Definition: sndvol32.h:87
uint32_t DWORD_PTR
Definition: typedefs.h:63
UINT MixersCount
Definition: sndvol32.h:85

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 }
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
HMIXER hmx
Definition: sndvol32.h:88
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS

Referenced by 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 }
static VOID OnVScroll(PDIALOG_DATA pDialogData, HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: tray.c:203
#define IDOK
Definition: winuser.h:824
struct _DIALOG_DATA DIALOG_DATA
static VOID OnTrayInitMixer(PDIALOG_DATA pDialogData, HWND hwndDlg)
Definition: tray.c:64
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
static VOID OnCommand(PDIALOG_DATA pDialogData, HWND hwndDlg, WPARAM wParam, LPARAM lParam)
Definition: tray.c:173
PMIXERCONTROLDETAILS_UNSIGNED volumeInitValues
Definition: tray.c:21
#define SetWindowLongPtr
Definition: treelist.c:70
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
struct _DIALOG_DATA * PDIALOG_DATA
static VOID OnTrayInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: tray.c:29
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
PMIXERCONTROLDETAILS_UNSIGNED volumeCurrentValues
Definition: tray.c:22
#define DWLP_USER
Definition: winuser.h:866
#define WM_COMMAND
Definition: winuser.h:1716
HMIXER hMixer
Definition: tray.c:12
#define WM_ACTIVATE
Definition: winuser.h:1594
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define WA_INACTIVE
Definition: winuser.h:2576
#define GetWindowLongPtr
Definition: treelist.c:73
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define WM_VSCROLL
Definition: winuser.h:1720

Referenced by _tWinMain().

◆ UpdateDialogLineSliderControl()

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

Definition at line 700 of file dialog.c.

705 {
706  DWORD Index;
707  DWORD wID;
708  HWND hDlgCtrl;
709  WCHAR LineName[MIXER_LONG_NAME_CHARS];
710 
711  /* find the index of this line */
712  for (Index = 0; Index < PrefContext->Count; Index++)
713  {
714  /* get id */
715  wID = (Index + 1) * IDC_LINE_NAME;
716 
717  if (GetDlgItemText(PrefContext->MixerWindow->hWnd, wID, LineName, MIXER_LONG_NAME_CHARS) == 0)
718  {
719  /* failed to retrieve id */
720  continue;
721  }
722 
723  /* check if the line name matches */
724  if (!wcsicmp(LineName, Line->szName))
725  {
726  /* found matching line name */
727  wID = (Index + 1) * dwDialogID;
728 
729  /* get dialog control */
730  hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
731 
732  if (hDlgCtrl != NULL)
733  {
734  /* check state */
735  LRESULT OldPosition = SendMessageW(hDlgCtrl, TBM_GETPOS, 0, 0);
736  if (OldPosition != Position)
737  {
738  /* update control state */
740  }
741  }
742  break;
743  }
744  }
745 }
#define TRUE
Definition: types.h:120
__wchar_t WCHAR
Definition: xmlstorage.h:180
static COORD Position
Definition: mouse.c:34
#define TBM_SETPOS
Definition: commctrl.h:2008
UINT_PTR WPARAM
Definition: windef.h:207
#define TBM_GETPOS
Definition: commctrl.h:2003
#define IDC_LINE_NAME
Definition: resources.h:22
smooth NULL
Definition: ftsmooth.c:416
#define GetDlgItemText
Definition: winuser.h:5651
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: ncftp.h:79
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
#define wcsicmp
Definition: string.h:1152
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
LONG_PTR LRESULT
Definition: windef.h:209
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:95

Referenced by MixerControlChangeCallback().

◆ UpdateDialogLineSwitchControl()

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

Definition at line 654 of file dialog.c.

658 {
659  DWORD Index;
660  DWORD wID;
661  HWND hDlgCtrl;
662  WCHAR LineName[MIXER_LONG_NAME_CHARS];
663 
664  /* find the index of this line */
665  for (Index = 0; Index < PrefContext->Count; Index++)
666  {
667  /* get id */
668  wID = (Index + 1) * IDC_LINE_NAME;
669 
670  if (GetDlgItemText(PrefContext->MixerWindow->hWnd, wID, LineName, MIXER_LONG_NAME_CHARS) == 0)
671  {
672  /* failed to retrieve id */
673  continue;
674  }
675 
676  /* check if the line name matches */
677  if (!wcsicmp(LineName, Line->szName))
678  {
679  /* found matching line name */
680  wID = (Index + 1) * IDC_LINE_SWITCH;
681 
682  /* get dialog control */
683  hDlgCtrl = GetDlgItem(PrefContext->MixerWindow->hWnd, wID);
684 
685  if (hDlgCtrl != NULL)
686  {
687  /* check state */
688  if (SendMessageW(hDlgCtrl, BM_GETCHECK, 0, 0) != fValue)
689  {
690  /* update control state */
691  SendMessageW(hDlgCtrl, BM_SETCHECK, (WPARAM)fValue, 0);
692  }
693  }
694  break;
695  }
696  }
697 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT_PTR WPARAM
Definition: windef.h:207
#define IDC_LINE_NAME
Definition: resources.h:22
smooth NULL
Definition: ftsmooth.c:416
#define BM_GETCHECK
Definition: winuser.h:1879
#define BM_SETCHECK
Definition: winuser.h:1882
#define GetDlgItemText
Definition: winuser.h:5651
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: ncftp.h:79
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
#define wcsicmp
Definition: string.h:1152
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetDlgItem(HWND hDlg, int nIDDlgItem)
Definition: dialog.c:2113
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:95
#define IDC_LINE_SWITCH
Definition: resources.h:23

Referenced by MixerControlChangeCallback().

◆ WriteLineConfig()

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

Definition at line 162 of file misc.c.

166 {
167  HKEY hLineKey;
168  TCHAR szDevRegKey[MAX_PATH];
169  BOOL Ret = FALSE;
170 
171  _stprintf(szDevRegKey,
172  TEXT("%s\\%s"),
173  szDeviceName,
174  szLineName);
175 
177  szDevRegKey,
178  0,
179  NULL,
182  NULL,
183  &hLineKey,
184  NULL) == ERROR_SUCCESS)
185  {
186  /* now update line states */
187  RegSetValueEx(hLineKey, LineStatesValue, 0, REG_BINARY, (const BYTE*)LineState, cbSize);
188  Ret = TRUE;
189 
190  RegCloseKey(hLineKey);
191  }
192 
193  return Ret;
194 }
HKEY hAppSettingsKey
Definition: misc.c:135
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static const TCHAR LineStatesValue[]
Definition: misc.c:132
smooth NULL
Definition: ftsmooth.c:416
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
char TCHAR
Definition: xmlstorage.h:189
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAX_PATH
Definition: compat.h:26
unsigned char BYTE
Definition: mem.h:68
static const WCHAR szDeviceName[]
Definition: provider.c:53
#define _stprintf
Definition: utility.h:124
#define TEXT(s)
Definition: k32.h:26
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501

Referenced by WriteLineSettings().

Variable Documentation

◆ hAppHeap

◆ hAppInstance

HINSTANCE hAppInstance

Definition at line 23 of file mmc.c.

◆ hAppSettingsKey

HKEY hAppSettingsKey

Definition at line 135 of file misc.c.

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

◆ hMainWnd

HWND hMainWnd

Definition at line 33 of file magnifier.c.

◆ MainWindowClass

ATOM MainWindowClass

Definition at line 31 of file sndvol32.c.

Referenced by RegisterApplicationClasses().