- Add an audio configure button with code to display the selected

audio driver's configure dialog.
- Add an audio control panel launch button.
oldstable
Robert Reif 2005-06-28 19:12:52 +00:00 committed by Alexandre Julliard
parent 44bc9f7a0b
commit 8881284373
4 changed files with 59 additions and 1 deletions

View File

@ -139,6 +139,8 @@ BEGIN
LTEXT "Audio driver: ",IDC_STATIC,10,20,60,8
COMBOBOX IDC_AUDIO_DRIVER,70,18,85,85,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Autodetect",IDC_AUDIO_AUTODETECT,170,20,49,14
PUSHBUTTON "Configure",IDC_AUDIO_CONFIGURE,170,40,49,14
PUSHBUTTON "Control Panel",IDC_AUDIO_CONTROL_PANEL,170,60,49,14
END
STRINGTABLE DISCARDABLE

View File

@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = winecfg.exe
APPMODE = -mwindows
IMPORTS = comdlg32 comctl32 shell32 ole32 shlwapi user32 advapi32 kernel32
IMPORTS = comdlg32 comctl32 shell32 ole32 winmm shlwapi user32 advapi32 kernel32
C_SRCS = \
appdefaults.c \

View File

@ -37,6 +37,7 @@
#include <shlguid.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <mmsystem.h>
#include "winecfg.h"
#include "resource.h"
@ -64,6 +65,49 @@ static void selectAudioDriver(HWND hDlg, const char *drivername)
}
}
static void configureAudioDriver(HWND hDlg, const char *drivername)
{
int i;
const AUDIO_DRIVER *pAudioDrv = NULL;
if ((pAudioDrv = getAudioDrivers()))
{
for (i = 0; *pAudioDrv->szName; i++, pAudioDrv++)
{
if (!strcmp (pAudioDrv->szDriver, drivername))
{
if (strlen(pAudioDrv->szDriver) != 0)
{
HDRVR hdrvr;
char wine_driver[MAX_NAME_LENGTH + 8];
sprintf(wine_driver, "wine%s.drv", pAudioDrv->szDriver);
hdrvr = OpenDriverA(wine_driver, 0, 0);
if (hdrvr != 0)
{
if (SendDriverMessage(hdrvr, DRV_QUERYCONFIGURE, 0, 0) != 0)
{
DRVCONFIGINFO dci;
LONG lRes;
dci.dwDCISize = sizeof (dci);
dci.lpszDCISectionName = (LPWSTR)0;
dci.lpszDCIAliasName = (LPWSTR)0;
lRes = SendDriverMessage(hdrvr, DRV_CONFIGURE, 0, (LONG)&dci);
}
CloseDriver(hdrvr, 0, 0);
}
else
{
char str[1024];
sprintf(str, "Couldn't open %s!", wine_driver);
MessageBox(NULL, str, "Fixme", MB_OK | MB_ICONERROR);
}
}
break;
}
}
}
}
static void initAudioDlg (HWND hDlg)
{
char *curAudioDriver = get_reg_key(config_key, "Drivers", "Audio", "alsa");
@ -172,6 +216,16 @@ AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
selectAudioDriver(hDlg, (char*)pAudioDrv[selected_driver].szDriver);
}
break;
case IDC_AUDIO_CONFIGURE:
{
const AUDIO_DRIVER *pAudioDrv = getAudioDrivers();
int selected_driver = SendDlgItemMessage(hDlg, IDC_AUDIO_DRIVER, CB_GETCURSEL, 0, 0);
configureAudioDriver(hDlg, (char*)pAudioDrv[selected_driver].szDriver);
}
break;
case IDC_AUDIO_CONTROL_PANEL:
MessageBox(NULL, "Launching audio control panel not implemented yet!", "Fixme", MB_OK | MB_ICONERROR);
break;
}
break;

View File

@ -123,3 +123,5 @@
/* audio tab */
#define IDC_AUDIO_AUTODETECT 1300
#define IDC_AUDIO_DRIVER 1301
#define IDC_AUDIO_CONFIGURE 1302
#define IDC_AUDIO_CONTROL_PANEL 1303