mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:12:56 +00:00
[MMSYS]
- Implement audio selection button svn path=/trunk/; revision=59220
This commit is contained in:
parent
24b5b19981
commit
ca1b982148
3 changed files with 43 additions and 2 deletions
|
@ -24,7 +24,8 @@ add_importlibs(mmsys
|
||||||
setupapi
|
setupapi
|
||||||
shlwapi
|
shlwapi
|
||||||
ntdll
|
ntdll
|
||||||
kernel32)
|
kernel32
|
||||||
|
comdlg32)
|
||||||
|
|
||||||
add_pch(mmsys mmsys.h)
|
add_pch(mmsys mmsys.h)
|
||||||
add_cd_file(TARGET mmsys DESTINATION reactos/system32 FOR all)
|
add_cd_file(TARGET mmsys DESTINATION reactos/system32 FOR all)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <devguid.h>
|
#include <devguid.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <shlwapi.h>
|
#include <shlwapi.h>
|
||||||
|
#include <commdlg.h>
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
//typedef LONG (CALLBACK *APPLET_PROC)(VOID);
|
//typedef LONG (CALLBACK *APPLET_PROC)(VOID);
|
||||||
|
|
|
@ -904,6 +904,11 @@ SoundsDlgProc(HWND hwndDlg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
OPENFILENAMEW ofn;
|
||||||
|
WCHAR filename[MAX_PATH];
|
||||||
|
LPWSTR pFileName;
|
||||||
|
LRESULT lResult;
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
|
@ -936,6 +941,41 @@ SoundsDlgProc(HWND hwndDlg,
|
||||||
{
|
{
|
||||||
switch (LOWORD(wParam))
|
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:
|
case IDC_PLAY_SOUND:
|
||||||
{
|
{
|
||||||
LRESULT lIndex;
|
LRESULT lIndex;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue