Author: dchapyshev
Date: Sun Jun 29 07:30:36 2008
New Revision: 34185
URL:
http://svn.reactos.org/svn/reactos?rev=34185&view=rev
Log:
- More implement "Audio" dialog
Modified:
trunk/reactos/dll/cpl/mmsys/audio.c
Modified: trunk/reactos/dll/cpl/mmsys/audio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/audio.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/audio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/audio.c [iso-8859-1] Sun Jun 29 07:30:36 2008
@@ -43,6 +43,7 @@
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 @@
if (CB_ERR != Res)
{
+ SendMessage(hCB, CB_SETITEMDATA, Res, (LPARAM) uIndex);
// TODO: Getting default device
SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
}
@@ -83,10 +85,32 @@
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 */
@@ -99,6 +123,7 @@
UNREFERENCED_PARAMETER(lParam);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(hwndDlg);
+
switch(uMsg)
{
case WM_INITDIALOG:
@@ -125,6 +150,74 @@
}
}
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;