43 int i, o2, o3, o4, o5;
44 bool Left,Right,BackLeft,BackRight,Center,Sub, CenterLeft, CenterRight;
58 if (!(Left || Right || BackLeft || BackRight || Center || Sub || CenterLeft || CenterRight)) {
73 for (
i=0;
i<SamplesPerSec;
i++) {
76 (*buffer)[(
i*Channels)+0] =
value;
79 (*buffer)[(
i*Channels)+1] =
value;
82 (*buffer)[(
i*Channels)+o2] =
value;
85 (*buffer)[(
i*Channels)+o3] =
value;
88 (*buffer)[(
i*Channels)+o4] =
value;
91 (*buffer)[(
i*Channels)+o5] = (
SHORT)(
cos(
i*
y)*amplitude*32767.0);
94 (*buffer)[(
i*Channels)+6] =
value;
97 (*buffer)[(
i*Channels)+7] =
value;
128 for (
i=0;
i<numDev;
i++) {
142 BOOL isChannelChecked;
159 wfx.wBitsPerSample = 16;
162 wfx.nAvgBytesPerSec =
SAMPLE_RATE * (wfx.wBitsPerSample >> 3) * wfx.nChannels;
163 wfx.nBlockAlign = (wfx.wBitsPerSample >> 3) * wfx.nChannels;
176 if (!isChannelChecked)
220 if ((*pGUID) !=
NULL) {
224 if (lpGUID !=
NULL) {
256 if (
ds->GetSpeakerConfig(&speakerConfig) !=
S_OK) {
302 if (
ds->SetSpeakerConfig(speakerConfig) !=
S_OK) {
319 TCHAR szServiceName[128];
382 DeviceInterfaceData.
cbSize =
sizeof(DeviceInterfaceData);
688 hURLFont =
CreateFont(20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
VARIABLE_PITCH |
FF_SWISS,
"MS Shell Dlg");
784 unsigned char usage[] =
"/h - print this help message\r\n" \
785 "/enable71Mode - change channel configuration to 7.1\r\n" \
786 "/enable51Mode - change channel configuration to 5.1\r\n" \
787 "/enable40Mode - change channel configuration to 4.0 (Quad)\r\n" \
788 "/enable20Mode - change channel configuration to 2.0 (Stereo)\r\n" \
789 "/enableSPDIFo - enable SPDIF-out\r\n" \
790 "/disableSPDIFo - disable SPDIF-out\r\n"\
791 "/enableSPDIFi - enable SPDIF-in recording\r\n" \
792 "/disableSPDIFi - disable SPDIF-in recording\r\n" \
793 "/enableLoopThru - enable loop-through from SPDIF-in to SPDIF-out\r\n" \
794 "/disableLoopThru - disable loop-through from SPDIF-in to SPDIF-out\r\n";
809 strcat(SysDir,
"\\cmicpl.cpl");
815 strcat(SysDir,
"\\cmicontrol.exe");
879 while (szCmdLine[
i]) {
881 if (szCmdLine[
i] ==
' ') {
894 if ((szCmdLine[
i] ==
'-') || (szCmdLine[
i] ==
'/')) {
939 if (szCmdLine && szCmdLine[0] != 0) {
_STLP_DECLSPEC complex< float > _STLP_CALL cos(const complex< float > &)
char * strcat(char *DstString, const char *SrcString)
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
VOID WINAPI InitCommonControls(void)
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HRESULT WINAPI DirectSoundCreate8(LPCGUID lpcGUID, LPDIRECTSOUND8 *ppDS, IUnknown *pUnkOuter)
#define INVALID_HANDLE_VALUE
VOID WINAPI ExitProcess(IN UINT uExitCode)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
BOOL getDeviceInfo(const GUID *category, CMIDEV *pDev)
int parseArguments(LPSTR szCmdLine)
void updateChannelBoxes(HWND hWnd)
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
BOOL initDialog(HWND hWnd)
BOOL setDriverData(CMIDEV *pDev)
BOOL setCurrentChannelConfig()
bool checkToken(char *token)
BOOL getCurrentChannelConfig()
BOOL CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext)
BOOL getDriverData(CMIDEV *pDev)
BOOL changeTab(LPNMHDR lpnmhdr)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
BOOL openDevice(bool handleError)
void PrintLastError(LPCSTR function)
BOOL getDeviceInterfaceDetail(const GUID *category, CMIDEV *pDev)
void openURL(int control)
BOOL generateTestSignal(double amplitude, int Channels, int SamplesPerSec, SHORT **buffer)
INT_PTR CALLBACK TabDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
BOOL setDlgItems(HWND hWnd)
#define SPEAKER_AMPLITUDE
#define SPEAKER_FREQUENCY
#define IDCB_CHANNELCONFIG
#define IDC_FMT_480_MULTI_PCM
#define IDC_FMT_441_DOLBY
#define IDC_EN_SPDCOPYRHT
#define IDC_FMT_960_DOLBY
#define IDC_EN_CENTER2MIC
#define IDC_FMT_882_DOLBY
#define IDC_EN_SPDIMONITOR
#define IDC_FMT_480_DOLBY
#define IDC_FMT_960_MULTI_PCM
#define IDC_FMT_882_MULTI_PCM
#define IDC_FMT_441_MULTI_PCM
#define DSSPEAKER_CONFIG(a)
#define DSSPEAKER_7POINT1
#define DirectSoundEnumerate
#define DSSPEAKER_5POINT1
#define KSPROPERTY_TYPE_SET
#define KSPROPERTY_TYPE_GET
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLsizeiptr const GLvoid GLenum usage
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
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 token
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
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define IOCTL_KS_PROPERTY
#define memcpy(s1, s2, n)
#define waveOutGetDevCaps
#define MAKELCID(lgid, srtid)
#define FMT_960_MULTI_PCM
#define FMT_441_MULTI_PCM
#define FMT_480_MULTI_PCM
#define KSPROPERTY_CMI_SET
#define KSPROPERTY_CMI_GET
#define FMT_882_MULTI_PCM
#define TabCtrl_InsertItem(hwnd, iItem, pitem)
#define SUBLANG_ENGLISH_US
SP_DEVICE_INTERFACE_DETAIL_DATA_A SP_DEVICE_INTERFACE_DETAIL_DATA
#define SetupDiGetDeviceInterfaceDetail
#define SetupDiGetDeviceInstanceId
#define SetupDiGetDeviceRegistryProperty
#define DIGCF_DEVICEINTERFACE
#define SetupDiGetClassDevs
SP_DEVICE_INTERFACE_DETAIL_DATA_A * PSP_DEVICE_INTERFACE_DETAIL_DATA
struct _SP_DEVINFO_DATA SP_DEVINFO_DATA
UInt32 enableSPDOCopyright
UInt32 invertValidBitSPDI
union WAVEFORMATEXTENSIBLE::@3027 Samples
PSP_DEVICE_INTERFACE_DETAIL_DATA InterfaceDetailData
CHAR DevicePath[ANYSIZE_ARRAY]
CHAR szPname[MAXPNAMELEN]
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define GetSystemDirectory
DWORD WINAPI GetLastError(void)
#define FORMAT_MESSAGE_FROM_SYSTEM
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
#define MOVEFILE_DELAY_UNTIL_REBOOT
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
UINT WINAPI waveOutGetNumDevs(void)
UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
#define HKEY_LOCAL_MACHINE
#define WM_CTLCOLORSTATIC
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define CreateDialogParam
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define MB_ICONEXCLAMATION
#define MB_ICONINFORMATION
BOOL WINAPI DestroyWindow(_In_ HWND)