mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:25:55 +00:00
- More implement "Audio" dialog
svn path=/trunk/; revision=34185
This commit is contained in:
parent
f34438b93e
commit
b6e4377917
1 changed files with 93 additions and 0 deletions
|
@ -43,6 +43,7 @@ InitAudioDlg(HWND hwnd)
|
|||
|
||||
if (CB_ERR != Res)
|
||||
{
|
||||
SendMessage(hCB, CB_SETITEMDATA, Res, (LPARAM) uIndex);
|
||||
// TODO: Getting default device
|
||||
SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
|
||||
}
|
||||
|
@ -63,6 +64,7 @@ InitAudioDlg(HWND hwnd)
|
|||
|
||||
if (CB_ERR != Res)
|
||||
{
|
||||
SendMessage(hCB, CB_SETITEMDATA, Res, (LPARAM) uIndex);
|
||||
// TODO: Getting default device
|
||||
SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
|
||||
}
|
||||
|
@ -83,12 +85,34 @@ InitAudioDlg(HWND hwnd)
|
|||
|
||||
if (CB_ERR != Res)
|
||||
{
|
||||
SendMessage(hCB, CB_SETITEMDATA, Res, (LPARAM) uIndex);
|
||||
// TODO: Getting default device
|
||||
SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static UINT
|
||||
GetDevNum(HWND hControl, DWORD Id)
|
||||
{
|
||||
int iCurSel;
|
||||
UINT DevNum;
|
||||
|
||||
iCurSel = SendMessage(hControl, CB_GETCURSEL, 0, 0);
|
||||
|
||||
if (iCurSel == CB_ERR)
|
||||
return 0;
|
||||
|
||||
DevNum = (UINT) SendMessage(hControl, CB_GETITEMDATA, iCurSel, 0);
|
||||
if (DevNum == (UINT) CB_ERR)
|
||||
return 0;
|
||||
|
||||
if (mixerGetID((HMIXEROBJ) DevNum, &DevNum, Id) != MMSYSERR_NOERROR)
|
||||
return 0;
|
||||
|
||||
return DevNum;
|
||||
}
|
||||
|
||||
/* Audio property page dialog callback */
|
||||
INT_PTR CALLBACK
|
||||
AudioDlgProc(HWND hwndDlg,
|
||||
|
@ -99,6 +123,7 @@ AudioDlgProc(HWND hwndDlg,
|
|||
UNREFERENCED_PARAMETER(lParam);
|
||||
UNREFERENCED_PARAMETER(wParam);
|
||||
UNREFERENCED_PARAMETER(hwndDlg);
|
||||
|
||||
switch(uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
|
@ -125,6 +150,74 @@ AudioDlgProc(HWND hwndDlg,
|
|||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
WCHAR szPath[MAX_PATH];
|
||||
|
||||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDC_VOLUME1_BTN:
|
||||
{
|
||||
wsprintf(szPath, L"sndvol32.exe -d %d",
|
||||
GetDevNum(GetDlgItem(hwndDlg, IDC_DEVICE_PLAY_LIST), MIXER_OBJECTF_WAVEOUT));
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
si.wShowWindow = SW_SHOW;
|
||||
|
||||
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ADV2_BTN:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_VOLUME2_BTN:
|
||||
{
|
||||
wsprintf(szPath, L"sndvol32.exe -r -d %d",
|
||||
GetDevNum(GetDlgItem(hwndDlg, IDC_DEVICE_REC_LIST), MIXER_OBJECTF_WAVEIN));
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
si.wShowWindow = SW_SHOW;
|
||||
|
||||
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ADV1_BTN:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_VOLUME3_BTN:
|
||||
{
|
||||
wsprintf(szPath, L"sndvol32.exe -d %d",
|
||||
GetDevNum(GetDlgItem(hwndDlg, IDC_DEVICE_MIDI_LIST), MIXER_OBJECTF_MIDIOUT));
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
si.wShowWindow = SW_SHOW;
|
||||
|
||||
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_ADV3_BTN:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue