ReactOS  0.4.13-dev-249-gcba1a2f
sndvol32.h
Go to the documentation of this file.
1 #ifndef __SNDVOL32_H
2 #define __SNDVOL32_H
3 
4 #include <stdarg.h>
5 
6 #include <windef.h>
7 #include <winbase.h>
8 #include <wingdi.h>
9 #include <winuser.h>
10 #include <mmsystem.h>
11 #include <commctrl.h>
12 #include <tchar.h>
13 #include <strsafe.h>
14 #include <assert.h>
15 
16 #include "resources.h"
17 
18 #define VOLUME_MIN 0
19 #define VOLUME_MAX 500
20 #define VOLUME_TICKS 5
21 #define VOLUME_PAGE_SIZE 100
22 #define BALANCE_LEFT 0
23 #define BALANCE_CENTER 32
24 #define BALANCE_RIGHT 64
25 #define BALANCE_STEPS 64
26 #define BALANCE_TICKS 1
27 #define BALANCE_PAGE_SIZE 12
28 
29 #define PLAY_MIXER 0
30 #define RECORD_MIXER 1
31 
32 #define ADVANCED_BUTTON_HEIGHT 16
33 
34 typedef enum _WINDOW_MODE
35 {
40 
41 typedef struct _MIXER_WINDOW
42 {
45  struct _SND_MIXER *Mixer;
50 
59 
60 extern HINSTANCE hAppInstance;
61 extern ATOM MainWindowClass;
62 extern HWND hMainWnd;
63 extern HANDLE hAppHeap;
64 
65 #define SZ_APP_CLASS TEXT("Volume Control")
66 
67 ULONG DbgPrint(PCH , ...);
68 #define DPRINT DbgPrint("SNDVOL32: %s:%i: ", __FILE__, __LINE__); DbgPrint
69 
70 
71 /*
72  * MIXER
73  */
74 
75 typedef struct _SND_MIXER_CONNECTION
76 {
82 
83 
84 typedef struct _SND_MIXER_DESTINATION
85 {
92 
93 typedef struct _SND_MIXER
94 {
98  HMIXER hmx;
102 
103 typedef struct _PREFERENCES_CONTEXT
104 {
108 
115 
118 
119 typedef struct _SET_VOLUME_CONTEXT
120 {
126 
127 typedef struct _ADVANCED_CONTEXT
128 {
134 
135 
136 /* NOTE: do NOT modify SNDVOL_REG_LINESTATE for binary compatibility with XP! */
137 typedef struct _SNDVOL_REG_LINESTATE
138 {
142 
143 
147 
148 PSND_MIXER SndMixerCreate(HWND hWndNotification, UINT MixerId);
151 BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId);
153 INT SndMixerSetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails);
154 INT SndMixerGetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails);
162 BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls);
163 LPMIXERLINE SndMixerGetLineByName(PSND_MIXER Mixer, DWORD LineID, LPWSTR LineName);
164 
165 /* advanced.c */
166 
167 INT_PTR
168 CALLBACK
170  HWND hwndDlg,
171  UINT uMsg,
172  WPARAM wParam,
173  LPARAM lParam);
174 
175 
176 /*
177  * dialog.c
178  */
182 
183 /*
184  * MISC
185  */
186 
187 extern HKEY hAppSettingsKey;
188 
189 BOOL
191 
192 VOID
194 
195 INT
196 AllocAndLoadString(OUT LPWSTR *lpTarget,
198  IN UINT uID);
199 
200 DWORD
202  IN UINT uID,
203  OUT LPWSTR *lpTarget,
204  ...);
205 
206 BOOL
208  IN LPTSTR szLineName,
209  IN LPTSTR szControlName,
210  OUT DWORD *Flags);
211 
212 BOOL
214  IN LPTSTR szLineName,
215  IN PSNDVOL_REG_LINESTATE LineState,
216  IN DWORD cbSize);
217 
218 DWORD
220 
221 /* tray.c */
222 
223 INT_PTR
224 CALLBACK
226  HWND hwndDlg,
227  UINT uMsg,
228  WPARAM wParam,
229  LPARAM lParam);
230 
231 #endif /* __SNDVOL32_H */
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context)
Definition: mixer.c:552
LPMIXERLINE Line
Definition: sndvol32.h:132
#define IN
Definition: typedefs.h:38
ATOM MainWindowClass
Definition: sndvol32.c:31
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
PSND_MIXER_DESTINATION Lines
Definition: sndvol32.h:100
UINT MixerId
Definition: sndvol32.h:52
INT_PTR CALLBACK AdvancedDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: advanced.c:225
VOID SndMixerDestroy(PSND_MIXER Mixer)
Definition: mixer.c:91
HANDLE hAppHeap
Definition: mmc.c:24
BOOL(CALLBACK * PFNSNDMIXENUMPRODUCTS)(PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context)
Definition: sndvol32.h:146
ULONG DbgPrint(PCH,...)
DWORD LoadAndFormatString(IN HINSTANCE hInstance, IN UINT uID, OUT LPWSTR *lpTarget,...)
Definition: misc.c:76
WORD ATOM
Definition: dimm.idl:113
enum _WINDOW_MODE WINDOW_MODE
struct _PREFERENCES_CONTEXT * PPREFERENCES_CONTEXT
static COORD Position
Definition: mouse.c:34
HFONT hFont
Definition: sndvol32.h:56
INT SndMixerGetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
Definition: mixer.c:498
#define CALLBACK
Definition: compat.h:27
struct _ADVANCED_CONTEXT * PADVANCED_CONTEXT
struct _SET_VOLUME_CONTEXT * PSET_VOLUME_CONTEXT
UINT_PTR WPARAM
Definition: windef.h:207
PSND_MIXER Mixer
Definition: sndvol32.h:106
INT_PTR CALLBACK TrayDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: tray.c:262
int32_t INT_PTR
Definition: typedefs.h:62
_WINDOW_MODE
Definition: sndvol32.h:34
struct _PREFERENCES_CONTEXT PREFERENCES_CONTEXT
#define BOOL
Definition: nt_native.h:43
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
CHAR * LPTSTR
Definition: xmlstorage.h:192
DWORD Id
HWND hWndNotification
Definition: sndvol32.h:96
struct _SND_MIXER_CONNECTION * PSND_MIXER_CONNECTION
struct _SNDVOL_REG_LINESTATE * PSNDVOL_REG_LINESTATE
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
HINSTANCE hInstance
Definition: charmap.c:20
struct _SNDVOL_REG_LINESTATE SNDVOL_REG_LINESTATE
INT SndMixerGetDestinationCount(PSND_MIXER Mixer)
Definition: mixer.c:520
HWND * Window
Definition: sndvol32.h:48
VOID CloseAppConfig(VOID)
Definition: misc.c:152
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:173
BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control)
Definition: mixer.c:598
CHAR * PCH
Definition: ntbasedef.h:398
struct _SND_MIXER * Mixer
Definition: sndvol32.h:45
struct _ADVANCED_CONTEXT ADVANCED_CONTEXT
VOID UpdateDialogLineSwitchControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, LONG fValue)
Definition: dialog.c:767
LONG_PTR LPARAM
Definition: windef.h:208
struct _SND_MIXER_DESTINATION * Next
Definition: sndvol32.h:86
LPMIXERCONTROL Controls
Definition: sndvol32.h:79
UINT SelectedLine
Definition: sndvol32.h:46
INT SndMixerSetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cChannels, DWORD cbDetails, LPVOID paDetails)
Definition: mixer.c:474
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:130
BOOL bShowExtendedControls
Definition: sndvol32.h:54
BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls)
Definition: mixer.c:112
struct _SND_MIXER_DESTINATION * PSND_MIXER_DESTINATION
UINT DialogCount
Definition: sndvol32.h:49
MIXERCAPS Caps
Definition: sndvol32.h:99
char TCHAR
Definition: xmlstorage.h:189
struct _MIXER_WINDOW MIXER_WINDOW
BOOL InitAppConfig(VOID)
Definition: misc.c:138
PSND_MIXER Mixer
Definition: sndvol32.h:131
HMIXER hmx
Definition: sndvol32.h:98
__wchar_t WCHAR
Definition: xmlstorage.h:180
PSND_MIXER_CONNECTION Connections
Definition: sndvol32.h:90
UINT WindowCount
Definition: sndvol32.h:47
unsigned long DWORD
Definition: ntddk_ex.h:95
WINDOW_MODE Mode
Definition: sndvol32.h:51
PSND_MIXER SndMixerCreate(HWND hWndNotification, UINT MixerId)
Definition: mixer.c:69
struct _MIXER_WINDOW * PMIXER_WINDOW
Definition: ncftp.h:79
WCHAR LineName[MIXER_LONG_NAME_CHARS]
Definition: sndvol32.h:140
VOID LoadDialogCtrls(PPREFERENCES_CONTEXT PrefContext)
Definition: dialog.c:674
INT SndMixerGetProductName(PSND_MIXER Mixer, LPTSTR lpBuffer, UINT uSize)
Definition: mixer.c:367
VOID SndMixerClose(PSND_MIXER Mixer)
Definition: mixer.c:101
struct _SND_MIXER_CONNECTION * Next
Definition: sndvol32.h:77
SIZE baseUnit
Definition: sndvol32.h:57
UINT MixerId
Definition: sndvol32.h:97
struct _SND_MIXER * PSND_MIXER
static const WCHAR szDeviceName[]
Definition: provider.c:53
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
WCHAR LineName[MIXER_LONG_NAME_CHARS]
Definition: sndvol32.h:121
static const WCHAR Control[]
Definition: interface.c:27
BOOL WriteLineConfig(IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN PSNDVOL_REG_LINESTATE LineState, IN DWORD cbSize)
Definition: misc.c:162
TCHAR DeviceName[128]
Definition: sndvol32.h:114
HINSTANCE hInst
Definition: dxdiag.c:13
enum _WINDOW_MODE * PWINDOW_MODE
BOOL SndMixerEnumLines(PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc, PVOID Context)
Definition: mixer.c:526
INT AllocAndLoadString(OUT LPWSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:50
_In_ ULONGLONG _In_ PUNICODE_STRING _In_ PUNICODE_STRING LongName
Definition: fsrtlfuncs.h:336
HINSTANCE hAppInstance
Definition: mmc.c:23
BOOL SndMixerEnumProducts(PSND_MIXER Mixer, PFNSNDMIXENUMPRODUCTS EnumProc, PVOID Context)
Definition: mixer.c:431
BOOL(CALLBACK * PFNSNDMIXENUMCONNECTIONS)(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context)
Definition: sndvol32.h:145
WCHAR LineName[MIXER_LONG_NAME_CHARS]
Definition: sndvol32.h:129
unsigned int UINT
Definition: ndis.h:50
HWND hMainWnd
Definition: magnifier.c:34
struct _SND_MIXER_DESTINATION SND_MIXER_DESTINATION
DWORD GetStyleValue(VOID)
Definition: misc.c:278
struct _SND_MIXER_CONNECTION SND_MIXER_CONNECTION
UINT MixersCount
Definition: sndvol32.h:95
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
LPMIXERLINE SndMixerGetLineByName(PSND_MIXER Mixer, DWORD LineID, LPWSTR LineName)
Definition: mixer.c:615
#define OUT
Definition: typedefs.h:39
UINT SndMixerGetSelection(PSND_MIXER Mixer)
Definition: mixer.c:361
struct tagContext Context
Definition: acpixf.h:1012
unsigned int ULONG
Definition: retypes.h:1
LPMIXERCONTROL Controls
Definition: sndvol32.h:88
static BOOL CALLBACK EnumProc(_In_ HWND hWnd, _In_ LPARAM lParam)
Definition: SetParent.c:53
struct _SND_MIXER SND_MIXER
INT SndMixerGetLineName(PSND_MIXER Mixer, DWORD LineID, LPTSTR lpBuffer, UINT uSize, BOOL LongName)
Definition: mixer.c:390
HKEY hAppSettingsKey
Definition: misc.c:135
BOOL bHasExtendedControls
Definition: sndvol32.h:53
BOOL(CALLBACK * PFNSNDMIXENUMLINES)(PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context)
Definition: sndvol32.h:144
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId)
Definition: mixer.c:304
LPARAM lParam
Definition: combotst.c:139
BOOL ReadLineConfig(IN LPTSTR szDeviceName, IN LPTSTR szLineName, IN LPTSTR szControlName, OUT DWORD *Flags)
Definition: misc.c:197
VOID UpdateDialogLineSliderControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, DWORD DialogID, DWORD Position)
Definition: dialog.c:813
struct _SET_VOLUME_CONTEXT SET_VOLUME_CONTEXT
HWND hStatusBar
Definition: sndvol32.h:44
struct Line Line
unsigned int * PUINT
Definition: ndis.h:50
PMIXER_WINDOW MixerWindow
Definition: sndvol32.h:105