Author: dchapyshev
Date: Sun Jun 29 05:13:55 2008
New Revision: 34183
URL:
http://svn.reactos.org/svn/reactos?rev=34183&view=rev
Log:
- Small implement "Audio" dialog
- Add setupapi.lib to rbuild-file
- Return ERROR_DI_DO_DEFAULT in MediaClassInstaller function
Modified:
trunk/reactos/dll/cpl/mmsys/audio.c
trunk/reactos/dll/cpl/mmsys/mmsys.c
trunk/reactos/dll/cpl/mmsys/mmsys.rbuild
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 05:13:55 2008
@@ -15,6 +15,79 @@
#include <stdio.h>
#include "mmsys.h"
#include "resource.h"
+
+
+VOID
+InitAudioDlg(HWND hwnd)
+{
+ WAVEOUTCAPS waveOutputPaps;
+ WAVEINCAPS waveInputPaps;
+ MIDIOUTCAPS midiOutCaps;
+ UINT DevsNum;
+ UINT uIndex;
+ HWND hCB;
+ LRESULT Res;
+
+ // Init sound playback devices list
+ hCB = GetDlgItem(hwnd, IDC_DEVICE_PLAY_LIST);
+
+ DevsNum = waveOutGetNumDevs();
+ if (DevsNum < 1) return;
+
+ for (uIndex = 0; uIndex < DevsNum; uIndex++)
+ {
+ if (waveOutGetDevCaps(uIndex, &waveOutputPaps, sizeof(waveOutputPaps)))
+ continue;
+
+ Res = SendMessage(hCB, CB_ADDSTRING, 0, (LPARAM) waveOutputPaps.szPname);
+
+ if (CB_ERR != Res)
+ {
+ // TODO: Getting default device
+ SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
+ }
+ }
+
+ // Init sound recording devices list
+ hCB = GetDlgItem(hwnd, IDC_DEVICE_REC_LIST);
+
+ DevsNum = waveInGetNumDevs();
+ if (DevsNum < 1) return;
+
+ for (uIndex = 0; uIndex < DevsNum; uIndex++)
+ {
+ if (waveInGetDevCaps(uIndex, &waveInputPaps, sizeof(waveInputPaps)))
+ continue;
+
+ Res = SendMessage(hCB, CB_ADDSTRING, 0, (LPARAM) waveInputPaps.szPname);
+
+ if (CB_ERR != Res)
+ {
+ // TODO: Getting default device
+ SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
+ }
+ }
+
+ // Init MIDI devices list
+ hCB = GetDlgItem(hwnd, IDC_DEVICE_MIDI_LIST);
+
+ DevsNum = midiOutGetNumDevs();
+ if (DevsNum < 1) return;
+
+ for (uIndex = 0; uIndex < DevsNum; uIndex++)
+ {
+ if (midiOutGetDevCaps(uIndex, &midiOutCaps, sizeof(midiOutCaps)))
+ continue;
+
+ Res = SendMessage(hCB, CB_ADDSTRING, 0, (LPARAM) midiOutCaps.szPname);
+
+ if (CB_ERR != Res)
+ {
+ // TODO: Getting default device
+ SendMessage(hCB, CB_SETCURSEL, (WPARAM) Res, 0);
+ }
+ }
+}
/* Audio property page dialog callback */
INT_PTR CALLBACK
@@ -46,6 +119,10 @@
EnableWindow(GetDlgItem(hwndDlg, IDC_VOLUME3_BTN), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADV3_BTN), FALSE);
}
+ else
+ {
+ InitAudioDlg(hwndDlg);
+ }
}
break;
}
Modified: trunk/reactos/dll/cpl/mmsys/mmsys.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/mmsys.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/mmsys.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/mmsys.c [iso-8859-1] Sun Jun 29 05:13:55 2008
@@ -16,6 +16,7 @@
#include <setupapi.h>
#include <devguid.h>
#include <cpl.h>
+#include <tchar.h>
#include <debug.h>
#include "mmsys.h"
@@ -34,7 +35,7 @@
UINT uNumberOfGuids,
HWPAGE_DISPLAYMODE DisplayMode);
-#define NUM_APPLETS (1)
+#define NUM_APPLETS (1)
HINSTANCE hApplet = 0;
@@ -157,43 +158,43 @@
DWORD
MMSYS_InstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD
MMSYS_RemoveDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD
MMSYS_AllowInstallDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD
MMSYS_SelectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD
MMSYS_DetectDevice(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD
MMSYS_SelectBestCompatDRV(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pspDevInfoData)
{
- return 0x0;
+ return ERROR_DI_DO_DEFAULT;
}
DWORD WINAPI
-MediaClassInstaller(DI_FUNCTION diFunction,
- HDEVINFO hDevInfo,
- PSP_DEVINFO_DATA pspDevInfoData)
+MediaClassInstaller(IN DI_FUNCTION diFunction,
+ IN HDEVINFO hDevInfo,
+ IN PSP_DEVINFO_DATA pspDevInfoData OPTIONAL)
{
switch (diFunction)
{
@@ -210,10 +211,7 @@
case DIF_SELECTBESTCOMPATDRV:
return MMSYS_SelectBestCompatDRV(hDevInfo, pspDevInfoData);
default:
- {
- DPRINT1("MediaClassInstaller() not supported function\n");
- return 0x0;
- }
+ return ERROR_DI_DO_DEFAULT;
}
}
Modified: trunk/reactos/dll/cpl/mmsys/mmsys.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/mmsys.rbuild…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/mmsys.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/mmsys.rbuild [iso-8859-1] Sun Jun 29 05:13:55 2008
@@ -14,6 +14,7 @@
<library>winmm</library>
<library>advapi32</library>
<library>shell32</library>
+ <library>setupapi</library>
<file>mmsys.c</file>
<file>sounds.c</file>
<file>volume.c</file>