2004-12-29 22:37:14 +00:00
|
|
|
#ifndef __SNDVOL32_H
|
|
|
|
#define __SNDVOL32_H
|
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <stdarg.h>
|
2014-01-13 12:42:34 +00:00
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winuser.h>
|
2004-12-29 22:37:14 +00:00
|
|
|
#include <mmsystem.h>
|
|
|
|
#include <commctrl.h>
|
|
|
|
#include <tchar.h>
|
2011-04-06 21:05:05 +00:00
|
|
|
#include <assert.h>
|
2004-12-29 22:37:14 +00:00
|
|
|
|
2013-01-24 23:00:42 +00:00
|
|
|
#include "resources.h"
|
|
|
|
|
2004-12-29 22:37:14 +00:00
|
|
|
typedef struct _MIXER_WINDOW
|
|
|
|
{
|
|
|
|
HWND hWnd;
|
|
|
|
HWND hStatusBar;
|
|
|
|
struct _SND_MIXER *Mixer;
|
|
|
|
UINT SelectedLine;
|
2011-04-06 21:05:05 +00:00
|
|
|
UINT WindowCount;
|
|
|
|
HWND * Window;
|
|
|
|
|
|
|
|
|
2004-12-29 22:37:14 +00:00
|
|
|
} MIXER_WINDOW, *PMIXER_WINDOW;
|
|
|
|
|
|
|
|
extern HINSTANCE hAppInstance;
|
|
|
|
extern ATOM MainWindowClass;
|
|
|
|
extern HWND hMainWnd;
|
|
|
|
extern HANDLE hAppHeap;
|
|
|
|
|
|
|
|
#define SZ_APP_CLASS TEXT("Volume Control")
|
|
|
|
|
2005-09-26 19:15:27 +00:00
|
|
|
ULONG DbgPrint(PCH , ...);
|
2011-04-09 10:36:25 +00:00
|
|
|
#define DPRINT DbgPrint("SNDVOL32: %s:%i: ", __FILE__, __LINE__); DbgPrint
|
2004-12-29 22:37:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MIXER
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct _SND_MIXER_CONNECTION
|
|
|
|
{
|
|
|
|
struct _SND_MIXER_CONNECTION *Next;
|
|
|
|
MIXERLINE Info;
|
|
|
|
LPMIXERCONTROL Controls;
|
2005-09-27 13:42:20 +00:00
|
|
|
UINT DisplayControls;
|
2004-12-29 22:37:14 +00:00
|
|
|
} SND_MIXER_CONNECTION, *PSND_MIXER_CONNECTION;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _SND_MIXER_DESTINATION
|
|
|
|
{
|
|
|
|
struct _SND_MIXER_DESTINATION *Next;
|
|
|
|
MIXERLINE Info;
|
|
|
|
LPMIXERCONTROL Controls;
|
2005-09-27 13:42:20 +00:00
|
|
|
UINT DisplayControls;
|
2004-12-29 22:37:14 +00:00
|
|
|
PSND_MIXER_CONNECTION Connections;
|
|
|
|
} SND_MIXER_DESTINATION, *PSND_MIXER_DESTINATION;
|
|
|
|
|
|
|
|
typedef struct _SND_MIXER
|
|
|
|
{
|
|
|
|
UINT MixersCount;
|
|
|
|
HWND hWndNotification;
|
|
|
|
UINT MixerId;
|
|
|
|
HMIXER hmx;
|
|
|
|
MIXERCAPS Caps;
|
|
|
|
PSND_MIXER_DESTINATION Lines;
|
|
|
|
} SND_MIXER, *PSND_MIXER;
|
|
|
|
|
2011-04-06 21:05:05 +00:00
|
|
|
typedef struct _PREFERENCES_CONTEXT
|
|
|
|
{
|
|
|
|
PMIXER_WINDOW MixerWindow;
|
|
|
|
PSND_MIXER Mixer;
|
|
|
|
HWND hwndDlg;
|
|
|
|
|
|
|
|
UINT Selected;
|
|
|
|
DWORD SelectedLine;
|
|
|
|
DWORD PlaybackID;
|
|
|
|
DWORD RecordingID;
|
|
|
|
UINT OtherLines;
|
|
|
|
TCHAR DeviceName[128];
|
|
|
|
|
|
|
|
DWORD Count;
|
|
|
|
DWORD tmp;
|
|
|
|
} PREFERENCES_CONTEXT, *PPREFERENCES_CONTEXT;
|
|
|
|
|
2011-04-07 21:31:21 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WCHAR LineName[MIXER_LONG_NAME_CHARS];
|
|
|
|
UINT SliderPos;
|
|
|
|
BOOL bVertical;
|
|
|
|
BOOL bSwitch;
|
|
|
|
|
|
|
|
}SET_VOLUME_CONTEXT, *PSET_VOLUME_CONTEXT;
|
|
|
|
|
|
|
|
/* NOTE: do NOT modify SNDVOL_REG_LINESTATE for binary compatibility with XP! */
|
|
|
|
typedef struct _SNDVOL_REG_LINESTATE
|
|
|
|
{
|
|
|
|
DWORD Flags;
|
|
|
|
WCHAR LineName[MIXER_LONG_NAME_CHARS];
|
|
|
|
} SNDVOL_REG_LINESTATE, *PSNDVOL_REG_LINESTATE;
|
|
|
|
|
2011-04-06 21:05:05 +00:00
|
|
|
|
2005-09-27 13:42:20 +00:00
|
|
|
typedef BOOL (CALLBACK *PFNSNDMIXENUMLINES)(PSND_MIXER Mixer, LPMIXERLINE Line, UINT DisplayControls, PVOID Context);
|
2005-09-27 01:02:15 +00:00
|
|
|
typedef BOOL (CALLBACK *PFNSNDMIXENUMCONNECTIONS)(PSND_MIXER Mixer, DWORD LineID, LPMIXERLINE Line, PVOID Context);
|
2004-12-29 22:37:14 +00:00
|
|
|
typedef BOOL (CALLBACK *PFNSNDMIXENUMPRODUCTS)(PSND_MIXER Mixer, UINT Id, LPCTSTR ProductName, PVOID Context);
|
|
|
|
|
|
|
|
PSND_MIXER SndMixerCreate(HWND hWndNotification);
|
|
|
|
VOID SndMixerDestroy(PSND_MIXER Mixer);
|
|
|
|
VOID SndMixerClose(PSND_MIXER Mixer);
|
|
|
|
BOOL SndMixerSelect(PSND_MIXER Mixer, UINT MixerId);
|
|
|
|
UINT SndMixerGetSelection(PSND_MIXER Mixer);
|
2011-04-07 21:31:21 +00:00
|
|
|
INT SndMixerSetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cbDetails, LPVOID paDetails);
|
|
|
|
INT SndMixerGetVolumeControlDetails(PSND_MIXER Mixer, DWORD dwControlID, DWORD cbDetails, LPVOID paDetails);
|
2004-12-29 22:37:14 +00:00
|
|
|
INT SndMixerGetProductName(PSND_MIXER Mixer, LPTSTR lpBuffer, UINT uSize);
|
2005-09-27 13:42:20 +00:00
|
|
|
INT SndMixerGetLineName(PSND_MIXER Mixer, DWORD LineID, LPTSTR lpBuffer, UINT uSize, BOOL LongName);
|
2004-12-29 22:37:14 +00:00
|
|
|
BOOL SndMixerEnumProducts(PSND_MIXER Mixer, PFNSNDMIXENUMPRODUCTS EnumProc, PVOID Context);
|
|
|
|
INT SndMixerGetDestinationCount(PSND_MIXER Mixer);
|
2005-09-27 01:02:15 +00:00
|
|
|
BOOL SndMixerEnumLines(PSND_MIXER Mixer, PFNSNDMIXENUMLINES EnumProc, PVOID Context);
|
|
|
|
BOOL SndMixerEnumConnections(PSND_MIXER Mixer, DWORD LineID, PFNSNDMIXENUMCONNECTIONS EnumProc, PVOID Context);
|
2005-09-27 13:42:20 +00:00
|
|
|
BOOL SndMixerIsDisplayControl(PSND_MIXER Mixer, LPMIXERCONTROL Control);
|
2011-04-07 21:31:21 +00:00
|
|
|
BOOL SndMixerQueryControls(PSND_MIXER Mixer, PUINT DisplayControls, LPMIXERLINE LineInfo, LPMIXERCONTROL *Controls);
|
2004-12-29 22:37:14 +00:00
|
|
|
|
2011-04-06 21:05:05 +00:00
|
|
|
/*
|
|
|
|
* dialog.c
|
|
|
|
*/
|
2011-04-07 21:31:21 +00:00
|
|
|
VOID LoadDialogCtrls(PPREFERENCES_CONTEXT PrefContext);
|
|
|
|
VOID UpdateDialogLineSliderControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, DWORD dwControlID, DWORD DialogID, DWORD Position);
|
|
|
|
VOID UpdateDialogLineSwitchControl(PPREFERENCES_CONTEXT PrefContext, LPMIXERLINE Line, LONG fValue);
|
2011-04-06 21:05:05 +00:00
|
|
|
|
2005-09-26 19:15:27 +00:00
|
|
|
/*
|
|
|
|
* MISC
|
|
|
|
*/
|
2005-09-27 13:42:20 +00:00
|
|
|
|
|
|
|
extern HKEY hAppSettingsKey;
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
InitAppConfig(VOID);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
CloseAppConfig(VOID);
|
|
|
|
|
2005-09-26 19:15:27 +00:00
|
|
|
INT
|
|
|
|
AllocAndLoadString(OUT LPWSTR *lpTarget,
|
|
|
|
IN HINSTANCE hInst,
|
|
|
|
IN UINT uID);
|
|
|
|
|
|
|
|
DWORD
|
|
|
|
LoadAndFormatString(IN HINSTANCE hInstance,
|
|
|
|
IN UINT uID,
|
|
|
|
OUT LPWSTR *lpTarget,
|
|
|
|
...);
|
|
|
|
|
2005-09-27 13:42:20 +00:00
|
|
|
BOOL
|
|
|
|
ReadLineConfig(IN LPTSTR szDeviceName,
|
|
|
|
IN LPTSTR szLineName,
|
|
|
|
IN LPTSTR szControlName,
|
|
|
|
OUT DWORD *Flags);
|
|
|
|
|
2011-04-07 21:31:21 +00:00
|
|
|
BOOL
|
|
|
|
WriteLineConfig(IN LPTSTR szDeviceName,
|
|
|
|
IN LPTSTR szLineName,
|
2011-04-08 22:04:41 +00:00
|
|
|
IN PSNDVOL_REG_LINESTATE LineState,
|
|
|
|
IN DWORD cbSize);
|
2011-04-07 21:31:21 +00:00
|
|
|
|
2004-12-29 22:37:14 +00:00
|
|
|
#endif /* __SNDVOL32_H */
|