sync with trunk r46493
[reactos.git] / base / applications / sndvol32 / sndvol32.h
1 #ifndef __SNDVOL32_H
2 #define __SNDVOL32_H
3
4 #include <windows.h>
5 #include <mmsystem.h>
6 #include <commctrl.h>
7 #include <shellapi.h>
8 #include <stdio.h>
9 #include <tchar.h>
10 #include <string.h>
11 #include "resources.h"
12
13 typedef struct _MIXER_WINDOW
14 {
15 HWND hWnd;
16 HWND hStatusBar;
17 struct _SND_MIXER *Mixer;
18 UINT SelectedLine;
19 } MIXER_WINDOW, *PMIXER_WINDOW;
20
21 extern HINSTANCE hAppInstance;
22 extern ATOM MainWindowClass;
23 extern HWND hMainWnd;
24 extern HANDLE hAppHeap;
25
26 #define SZ_APP_CLASS TEXT("Volume Control")
27
28 ULONG DbgPrint(PCH , ...);
29 #define DPRINT DbgPrint("SNDVOL32: %s:%i: ", __FILE__, __LINE__); DbgPrint
30
31
32 /*
33 * MIXER
34 */
35
36 typedef struct _SND_MIXER_CONNECTION
37 {
38 struct _SND_MIXER_CONNECTION *Next;
39 MIXERLINE Info;
40 LPMIXERCONTROL Controls;
41 UINT DisplayControls;
42 } SND_MIXER_CONNECTION, *PSND_MIXER_CONNECTION;
43
44
45 typedef struct _SND_MIXER_DESTINATION
46 {
47 struct _SND_MIXER_DESTINATION *Next;
48 MIXERLINE Info;
49 LPMIXERCONTROL Controls;
50 UINT DisplayControls;
51 PSND_MIXER_CONNECTION Connections;
52 } SND_MIXER_DESTINATION, *PSND_MIXER_DESTINATION;
53
54 typedef struct _SND_MIXER
55 {
56 UINT MixersCount;
57 HWND hWndNotification;
58 UINT MixerId;
59 HMIXER hmx;
60 MIXERCAPS Caps;
61 PSND_MIXER_DESTINATION Lines;
62 } SND_MIXER, *PSND_MIXER;
63
64 typedef BOOL (CALLBACK *PFNSNDMIXENUMLINES)(PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context);
65 typedef BOOL (CALLBACK *PFNSNDMIXENUMCONNECTIONS)(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context);
66 typedef BOOL (CALLBACK *PFNSNDMIXENUMPRODUCTS)(PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context);
67
68 PSND_MIXER SndMixerCreate(HWND hWndNotification);
69 VOID SndMixerDestroy(PSND_MIXER Mixer);
70 VOID SndMixerClose(PSND_MIXER Mixer);
71 BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId);
72 UINT SndMixerGetSelection(PSND_MIXER Mixer);
73 INT SndMixerGetProductName(PSND_MIXER Mixer, LPTSTR lpBuffer, UINT uSize);
74 INT SndMixerGetLineName(PSND_MIXER Mixer, DWORD LineID, LPTSTR lpBuffer, UINT uSize, BOOL LongName);
75 BOOL SndMixerEnumProducts(PSND_MIXER Mixer, PFNSNDMIXENUMPRODUCTS EnumProc, PVOID Context);
76 INT SndMixerGetDestinationCount(PSND_MIXER Mixer);
77 BOOL SndMixerEnumLines(PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc, PVOID Context);
78 BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context);
79 BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control);
80
81 /*
82 * MISC
83 */
84
85 extern HKEY hAppSettingsKey;
86
87 BOOL
88 InitAppConfig(VOID);
89
90 VOID
91 CloseAppConfig(VOID);
92
93 INT
94 AllocAndLoadString(OUT LPWSTR *lpTarget,
95 IN HINSTANCE hInst,
96 IN UINT uID);
97
98 DWORD
99 LoadAndFormatString(IN HINSTANCE hInstance,
100 IN UINT uID,
101 OUT LPWSTR *lpTarget,
102 ...);
103
104 BOOL
105 ReadLineConfig(IN LPTSTR szDeviceName,
106 IN LPTSTR szLineName,
107 IN LPTSTR szControlName,
108 OUT DWORD *Flags);
109
110 #endif /* __SNDVOL32_H */