Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d7b13bcd
Commit
d7b13bcd
authored
Aug 10, 2005
by
Francois Gouget
Committed by
Alexandre Julliard
Aug 10, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicodify wineesd.
Fixes WIDM_GETDEVCAPS and WODM_GETDEVCAPS. Call Unicode functions instead of their Ansi equivalent when possible.
parent
91f9c01c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
35 deletions
+16
-35
audio.c
dlls/winmm/wineesd/audio.c
+16
-35
No files found.
dlls/winmm/wineesd/audio.c
View file @
d7b13bcd
...
@@ -32,8 +32,6 @@
...
@@ -32,8 +32,6 @@
*
*
*/
*/
/*#define EMULATE_SB16*/
#include "config.h"
#include "config.h"
#include <math.h>
#include <math.h>
...
@@ -126,7 +124,7 @@ typedef struct {
...
@@ -126,7 +124,7 @@ typedef struct {
WAVEOPENDESC
waveDesc
;
WAVEOPENDESC
waveDesc
;
WORD
wFlags
;
WORD
wFlags
;
PCMWAVEFORMAT
format
;
PCMWAVEFORMAT
format
;
WAVEOUTCAPS
A
caps
;
WAVEOUTCAPS
W
caps
;
char
interface_name
[
32
];
char
interface_name
[
32
];
DWORD
dwSleepTime
;
/* Num of milliseconds to sleep between filling the dsp buffers */
DWORD
dwSleepTime
;
/* Num of milliseconds to sleep between filling the dsp buffers */
...
@@ -164,7 +162,7 @@ typedef struct {
...
@@ -164,7 +162,7 @@ typedef struct {
WAVEOPENDESC
waveDesc
;
WAVEOPENDESC
waveDesc
;
WORD
wFlags
;
WORD
wFlags
;
PCMWAVEFORMAT
format
;
PCMWAVEFORMAT
format
;
WAVEINCAPS
A
caps
;
WAVEINCAPS
W
caps
;
char
interface_name
[
32
];
char
interface_name
[
32
];
/* esd information */
/* esd information */
...
@@ -341,23 +339,14 @@ LONG ESD_WaveInit(void)
...
@@ -341,23 +339,14 @@ LONG ESD_WaveInit(void)
/* initialize all device handles to -1 */
/* initialize all device handles to -1 */
for
(
i
=
0
;
i
<
MAX_WAVEOUTDRV
;
++
i
)
for
(
i
=
0
;
i
<
MAX_WAVEOUTDRV
;
++
i
)
{
{
static
const
WCHAR
ini
[]
=
{
'E'
,
's'
,
'o'
,
'u'
,
'n'
,
'D'
,
' '
,
'W'
,
'a'
,
'v'
,
'e'
,
'O'
,
'u'
,
't'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
WOutDev
[
i
].
esd_fd
=
-
1
;
WOutDev
[
i
].
esd_fd
=
-
1
;
memset
(
&
WOutDev
[
i
].
caps
,
0
,
sizeof
(
WOutDev
[
i
].
caps
));
/* zero out
memset
(
&
WOutDev
[
i
].
caps
,
0
,
sizeof
(
WOutDev
[
i
].
caps
));
/* zero out
caps values */
caps values */
/* FIXME: some programs compare this string against the content of the registry
* for MM drivers. The names have to match in order for the program to work
* (e.g. MS win9x mplayer.exe)
*/
#ifdef EMULATE_SB16
WOutDev
[
i
].
caps
.
wMid
=
0x0002
;
WOutDev
[
i
].
caps
.
wPid
=
0x0104
;
strcpy
(
WOutDev
[
i
].
caps
.
szPname
,
"SB16 Wave Out"
);
#else
WOutDev
[
i
].
caps
.
wMid
=
0x00FF
;
/* Manufac ID */
WOutDev
[
i
].
caps
.
wMid
=
0x00FF
;
/* Manufac ID */
WOutDev
[
i
].
caps
.
wPid
=
0x0001
;
/* Product ID */
WOutDev
[
i
].
caps
.
wPid
=
0x0001
;
/* Product ID */
/* strcpy(WOutDev[i].caps.szPname, "OpenSoundSystem WAVOUT Driver");*/
lstrcpyW
(
WOutDev
[
i
].
caps
.
szPname
,
ini
);
strcpy
(
WOutDev
[
i
].
caps
.
szPname
,
"CS4236/37/38"
);
#endif
snprintf
(
WOutDev
[
i
].
interface_name
,
sizeof
(
WOutDev
[
i
].
interface_name
),
"wineesd: %d"
,
i
);
snprintf
(
WOutDev
[
i
].
interface_name
,
sizeof
(
WOutDev
[
i
].
interface_name
),
"wineesd: %d"
,
i
);
WOutDev
[
i
].
caps
.
vDriverVersion
=
0x0100
;
WOutDev
[
i
].
caps
.
vDriverVersion
=
0x0100
;
...
@@ -383,22 +372,14 @@ LONG ESD_WaveInit(void)
...
@@ -383,22 +372,14 @@ LONG ESD_WaveInit(void)
for
(
i
=
0
;
i
<
MAX_WAVEINDRV
;
++
i
)
for
(
i
=
0
;
i
<
MAX_WAVEINDRV
;
++
i
)
{
{
static
const
WCHAR
ini
[]
=
{
'E'
,
's'
,
'o'
,
'u'
,
'n'
,
'D'
,
' '
,
'W'
,
'a'
,
'v'
,
'e'
,
'I'
,
'n'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
WInDev
[
i
].
esd_fd
=
-
1
;
WInDev
[
i
].
esd_fd
=
-
1
;
memset
(
&
WInDev
[
i
].
caps
,
0
,
sizeof
(
WInDev
[
i
].
caps
));
/* zero out
memset
(
&
WInDev
[
i
].
caps
,
0
,
sizeof
(
WInDev
[
i
].
caps
));
/* zero out
caps values */
caps values */
/* FIXME: some programs compare this string against the content of the registry
* for MM drivers. The names have to match in order for the program to work
* (e.g. MS win9x mplayer.exe)
*/
#ifdef EMULATE_SB16
WInDev
[
i
].
caps
.
wMid
=
0x0002
;
WInDev
[
i
].
caps
.
wPid
=
0x0104
;
strcpy
(
WInDev
[
i
].
caps
.
szPname
,
"SB16 Wave In"
);
#else
WInDev
[
i
].
caps
.
wMid
=
0x00FF
;
WInDev
[
i
].
caps
.
wMid
=
0x00FF
;
WInDev
[
i
].
caps
.
wPid
=
0x0001
;
WInDev
[
i
].
caps
.
wPid
=
0x0001
;
strcpy
(
WInDev
[
i
].
caps
.
szPname
,
"CS4236/37/38"
);
lstrcpyW
(
WInDev
[
i
].
caps
.
szPname
,
ini
);
#endif
snprintf
(
WInDev
[
i
].
interface_name
,
sizeof
(
WInDev
[
i
].
interface_name
),
"wineesd: %d"
,
i
);
snprintf
(
WInDev
[
i
].
interface_name
,
sizeof
(
WInDev
[
i
].
interface_name
),
"wineesd: %d"
,
i
);
WInDev
[
i
].
caps
.
vDriverVersion
=
0x0100
;
WInDev
[
i
].
caps
.
vDriverVersion
=
0x0100
;
...
@@ -434,7 +415,7 @@ static int ESD_InitRingMessage(ESD_MSG_RING* mr)
...
@@ -434,7 +415,7 @@ static int ESD_InitRingMessage(ESD_MSG_RING* mr)
{
{
mr
->
msg_toget
=
0
;
mr
->
msg_toget
=
0
;
mr
->
msg_tosave
=
0
;
mr
->
msg_tosave
=
0
;
mr
->
msg_event
=
CreateEvent
A
(
NULL
,
FALSE
,
FALSE
,
NULL
);
mr
->
msg_event
=
CreateEvent
W
(
NULL
,
FALSE
,
FALSE
,
NULL
);
mr
->
ring_buffer_size
=
ESD_RING_BUFFER_INCREMENT
;
mr
->
ring_buffer_size
=
ESD_RING_BUFFER_INCREMENT
;
mr
->
messages
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mr
->
ring_buffer_size
*
sizeof
(
RING_MSG
));
mr
->
messages
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mr
->
ring_buffer_size
*
sizeof
(
RING_MSG
));
InitializeCriticalSection
(
&
mr
->
msg_crst
);
InitializeCriticalSection
(
&
mr
->
msg_crst
);
...
@@ -485,7 +466,7 @@ static int ESD_AddRingMessage(ESD_MSG_RING* mr, enum win_wm_message msg, DWORD p
...
@@ -485,7 +466,7 @@ static int ESD_AddRingMessage(ESD_MSG_RING* mr, enum win_wm_message msg, DWORD p
}
}
if
(
wait
)
if
(
wait
)
{
{
hEvent
=
CreateEvent
A
(
NULL
,
FALSE
,
FALSE
,
NULL
);
hEvent
=
CreateEvent
W
(
NULL
,
FALSE
,
FALSE
,
NULL
);
if
(
hEvent
==
INVALID_HANDLE_VALUE
)
if
(
hEvent
==
INVALID_HANDLE_VALUE
)
{
{
ERR
(
"can't create event !?
\n
"
);
ERR
(
"can't create event !?
\n
"
);
...
@@ -1047,7 +1028,7 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt)
...
@@ -1047,7 +1028,7 @@ static DWORD CALLBACK wodPlayer(LPVOID pmt)
/**************************************************************************
/**************************************************************************
* wodGetDevCaps [internal]
* wodGetDevCaps [internal]
*/
*/
static
DWORD
wodGetDevCaps
(
WORD
wDevID
,
LPWAVEOUTCAPS
A
lpCaps
,
DWORD
dwSize
)
static
DWORD
wodGetDevCaps
(
WORD
wDevID
,
LPWAVEOUTCAPS
W
lpCaps
,
DWORD
dwSize
)
{
{
TRACE
(
"(%u, %p, %lu);
\n
"
,
wDevID
,
lpCaps
,
dwSize
);
TRACE
(
"(%u, %p, %lu);
\n
"
,
wDevID
,
lpCaps
,
dwSize
);
...
@@ -1167,7 +1148,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -1167,7 +1148,7 @@ static DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* create player thread */
/* create player thread */
if
(
!
(
dwFlags
&
WAVE_DIRECTSOUND
))
{
if
(
!
(
dwFlags
&
WAVE_DIRECTSOUND
))
{
wwo
->
hStartUpEvent
=
CreateEvent
A
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwo
->
hStartUpEvent
=
CreateEvent
W
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwo
->
hThread
=
CreateThread
(
NULL
,
0
,
wodPlayer
,
(
LPVOID
)(
DWORD
)
wDevID
,
0
,
&
(
wwo
->
dwThreadID
));
wwo
->
hThread
=
CreateThread
(
NULL
,
0
,
wodPlayer
,
(
LPVOID
)(
DWORD
)
wDevID
,
0
,
&
(
wwo
->
dwThreadID
));
WaitForSingleObject
(
wwo
->
hStartUpEvent
,
INFINITE
);
WaitForSingleObject
(
wwo
->
hStartUpEvent
,
INFINITE
);
CloseHandle
(
wwo
->
hStartUpEvent
);
CloseHandle
(
wwo
->
hStartUpEvent
);
...
@@ -1532,7 +1513,7 @@ DWORD WINAPI ESD_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
...
@@ -1532,7 +1513,7 @@ DWORD WINAPI ESD_wodMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case
WODM_BREAKLOOP
:
return
wodBreakLoop
(
wDevID
);
case
WODM_BREAKLOOP
:
return
wodBreakLoop
(
wDevID
);
case
WODM_PREPARE
:
return
wodPrepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WODM_PREPARE
:
return
wodPrepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WODM_UNPREPARE
:
return
wodUnprepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WODM_UNPREPARE
:
return
wodUnprepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WODM_GETDEVCAPS
:
return
wodGetDevCaps
(
wDevID
,
(
LPWAVEOUTCAPS
A
)
dwParam1
,
dwParam2
);
case
WODM_GETDEVCAPS
:
return
wodGetDevCaps
(
wDevID
,
(
LPWAVEOUTCAPS
W
)
dwParam1
,
dwParam2
);
case
WODM_GETNUMDEVS
:
return
wodGetNumDevs
();
case
WODM_GETNUMDEVS
:
return
wodGetNumDevs
();
case
WODM_GETPITCH
:
return
MMSYSERR_NOTSUPPORTED
;
case
WODM_GETPITCH
:
return
MMSYSERR_NOTSUPPORTED
;
case
WODM_SETPITCH
:
return
MMSYSERR_NOTSUPPORTED
;
case
WODM_SETPITCH
:
return
MMSYSERR_NOTSUPPORTED
;
...
@@ -1623,7 +1604,7 @@ static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD
...
@@ -1623,7 +1604,7 @@ static DWORD widNotifyClient(WINE_WAVEIN* wwi, WORD wMsg, DWORD dwParam1, DWORD
/**************************************************************************
/**************************************************************************
* widGetDevCaps [internal]
* widGetDevCaps [internal]
*/
*/
static
DWORD
widGetDevCaps
(
WORD
wDevID
,
LPWAVEINCAPS
A
lpCaps
,
DWORD
dwSize
)
static
DWORD
widGetDevCaps
(
WORD
wDevID
,
LPWAVEINCAPS
W
lpCaps
,
DWORD
dwSize
)
{
{
TRACE
(
"(%u, %p, %lu);
\n
"
,
wDevID
,
lpCaps
,
dwSize
);
TRACE
(
"(%u, %p, %lu);
\n
"
,
wDevID
,
lpCaps
,
dwSize
);
...
@@ -1907,7 +1888,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
...
@@ -1907,7 +1888,7 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
/* create recorder thread */
/* create recorder thread */
if
(
!
(
dwFlags
&
WAVE_DIRECTSOUND
))
{
if
(
!
(
dwFlags
&
WAVE_DIRECTSOUND
))
{
wwi
->
hStartUpEvent
=
CreateEvent
A
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwi
->
hStartUpEvent
=
CreateEvent
W
(
NULL
,
FALSE
,
FALSE
,
NULL
);
wwi
->
hThread
=
CreateThread
(
NULL
,
0
,
widRecorder
,
(
LPVOID
)(
DWORD
)
wDevID
,
0
,
&
(
wwi
->
dwThreadID
));
wwi
->
hThread
=
CreateThread
(
NULL
,
0
,
widRecorder
,
(
LPVOID
)(
DWORD
)
wDevID
,
0
,
&
(
wwi
->
dwThreadID
));
WaitForSingleObject
(
wwi
->
hStartUpEvent
,
INFINITE
);
WaitForSingleObject
(
wwi
->
hStartUpEvent
,
INFINITE
);
CloseHandle
(
wwi
->
hStartUpEvent
);
CloseHandle
(
wwi
->
hStartUpEvent
);
...
@@ -2086,7 +2067,7 @@ DWORD WINAPI ESD_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
...
@@ -2086,7 +2067,7 @@ DWORD WINAPI ESD_widMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case
WIDM_ADDBUFFER
:
return
widAddBuffer
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_ADDBUFFER
:
return
widAddBuffer
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_PREPARE
:
return
widPrepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_PREPARE
:
return
widPrepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_UNPREPARE
:
return
widUnprepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_UNPREPARE
:
return
widUnprepare
(
wDevID
,
(
LPWAVEHDR
)
dwParam1
,
dwParam2
);
case
WIDM_GETDEVCAPS
:
return
widGetDevCaps
(
wDevID
,
(
LPWAVEINCAPS
A
)
dwParam1
,
dwParam2
);
case
WIDM_GETDEVCAPS
:
return
widGetDevCaps
(
wDevID
,
(
LPWAVEINCAPS
W
)
dwParam1
,
dwParam2
);
case
WIDM_GETNUMDEVS
:
return
widGetNumDevs
();
case
WIDM_GETNUMDEVS
:
return
widGetNumDevs
();
case
WIDM_RESET
:
return
widReset
(
wDevID
);
case
WIDM_RESET
:
return
widReset
(
wDevID
);
case
WIDM_START
:
return
widStart
(
wDevID
);
case
WIDM_START
:
return
widStart
(
wDevID
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment