Author: janderwald
Date: Sat Jun 15 08:23:21 2013
New Revision: 59220
URL:
http://svn.reactos.org/svn/reactos?rev=59220&view=rev
Log:
[MMSYS]
- Implement audio selection button
Modified:
trunk/reactos/dll/cpl/mmsys/CMakeLists.txt
trunk/reactos/dll/cpl/mmsys/mmsys.h
trunk/reactos/dll/cpl/mmsys/sounds.c
Modified: trunk/reactos/dll/cpl/mmsys/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/CMakeLists.t…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/CMakeLists.txt [iso-8859-1] Sat Jun 15 08:23:21 2013
@@ -24,7 +24,8 @@
setupapi
shlwapi
ntdll
- kernel32)
+ kernel32
+ comdlg32)
add_pch(mmsys mmsys.h)
add_cd_file(TARGET mmsys DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/dll/cpl/mmsys/mmsys.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/mmsys.h?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/mmsys.h [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/mmsys.h [iso-8859-1] Sat Jun 15 08:23:21 2013
@@ -17,7 +17,7 @@
#include <devguid.h>
#include <debug.h>
#include <shlwapi.h>
-
+#include <commdlg.h>
#include "resource.h"
//typedef LONG (CALLBACK *APPLET_PROC)(VOID);
Modified: trunk/reactos/dll/cpl/mmsys/sounds.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/sounds.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/sounds.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/sounds.c [iso-8859-1] Sat Jun 15 08:23:21 2013
@@ -904,6 +904,11 @@
WPARAM wParam,
LPARAM lParam)
{
+ OPENFILENAMEW ofn;
+ WCHAR filename[MAX_PATH];
+ LPWSTR pFileName;
+ LRESULT lResult;
+
switch (uMsg)
{
case WM_INITDIALOG:
@@ -936,6 +941,41 @@
{
switch (LOWORD(wParam))
{
+ case IDC_BROWSE_SOUND:
+ {
+ ZeroMemory(&ofn, sizeof(OPENFILENAMEW));
+ ofn.lStructSize = sizeof(OPENFILENAMEW);
+ ofn.hwndOwner = hwndDlg;
+ ofn.lpstrFile = filename;
+ ofn.lpstrFile[0] = L'\0';
+ ofn.nMaxFile = MAX_PATH;
+ ofn.lpstrFilter = L"Wave Files (*.wav)\0*.wav\0"; //FIXME
non-nls
+ ofn.nFilterIndex = 0;
+ ofn.lpstrFileTitle = L"Search for new sounds"; //FIXME
non-nls
+ ofn.nMaxFileTitle = wcslen(ofn.lpstrFileTitle);
+ ofn.lpstrInitialDir = NULL;
+ ofn.Flags = OFN_FILEMUSTEXIST;
+
+ if (GetOpenFileNameW(&ofn) == TRUE)
+ {
+ // FIXME search if list already contains that sound
+
+ // extract file name
+ pFileName = wcsrchr(filename, L'\\');
+ ASSERT(pFileName != NULL);
+ pFileName++;
+
+ // add to list
+ lResult = SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST,
CB_ADDSTRING, (WPARAM)0, (LPARAM)pFileName);
+ if (lResult != CB_ERR)
+ {
+ // add path and select item
+ SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETITEMDATA,
(WPARAM)lResult, (LPARAM)_wcsdup(filename));
+ SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETCURSEL,
(WPARAM)lResult, (LPARAM)0);
+ }
+ }
+ break;
+ }
case IDC_PLAY_SOUND:
{
LRESULT lIndex;