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
dbb03ec6
Commit
dbb03ec6
authored
Apr 19, 2004
by
Robert Reif
Committed by
Alexandre Julliard
Apr 19, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes support for older versions of direct sound.
Adds support for deleting notification array. Minor debug and white space cleanups.
parent
eb80f293
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
13 deletions
+66
-13
buffer.c
dlls/dsound/buffer.c
+9
-3
capture.c
dlls/dsound/capture.c
+22
-3
dsound_main.c
dlls/dsound/dsound_main.c
+10
-1
dsound.h
include/dsound.h
+25
-6
No files found.
dlls/dsound/buffer.c
View file @
dbb03ec6
...
...
@@ -100,7 +100,7 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
ICOM_THIS
(
IDirectSoundNotifyImpl
,
iface
);
TRACE
(
"(%p,0x%08lx,%p)
\n
"
,
This
,
howmuch
,
notify
);
if
(
notify
==
NULL
)
{
if
(
howmuch
>
0
&&
notify
==
NULL
)
{
WARN
(
"invalid parameter: notify == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -118,7 +118,7 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
if
(
hres
!=
DS_OK
)
WARN
(
"IDsDriverNotify_SetNotificationPositions failed
\n
"
);
return
hres
;
}
else
{
}
else
if
(
howmuch
>
0
)
{
/* Make an internal copy of the caller-supplied array.
* Replace the existing copy if one is already present. */
if
(
This
->
dsb
->
notifies
)
...
...
@@ -134,7 +134,13 @@ static HRESULT WINAPI IDirectSoundNotifyImpl_SetNotificationPositions(
}
memcpy
(
This
->
dsb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
This
->
dsb
->
nrofnotifies
=
howmuch
;
}
}
else
{
if
(
This
->
dsb
->
notifies
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
dsb
->
notifies
);
This
->
dsb
->
notifies
=
NULL
;
}
This
->
dsb
->
nrofnotifies
=
0
;
}
return
S_OK
;
}
...
...
dlls/dsound/capture.c
View file @
dbb03ec6
...
...
@@ -667,7 +667,8 @@ DSOUND_CreateDirectSoundCaptureBuffer(
return
DSERR_INVALIDPARAM
;
}
if
(
(
lpcDSCBufferDesc
->
dwSize
<
sizeof
(
DSCBUFFERDESC
))
||
if
(
((
lpcDSCBufferDesc
->
dwSize
!=
sizeof
(
DSCBUFFERDESC
))
&&
(
lpcDSCBufferDesc
->
dwSize
!=
sizeof
(
DSCBUFFERDESC1
)))
||
(
lpcDSCBufferDesc
->
dwBufferBytes
==
0
)
||
(
lpcDSCBufferDesc
->
lpwfxFormat
==
NULL
)
)
{
WARN
(
"invalid lpcDSCBufferDesc
\n
"
);
...
...
@@ -823,6 +824,8 @@ static ULONG WINAPI IDirectSoundCaptureNotifyImpl_Release(LPDIRECTSOUNDNOTIFY if
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
if
(
ref
==
0
)
{
if
(
This
->
dscb
->
hwnotify
)
IDsDriverNotify_Release
(
This
->
dscb
->
hwnotify
);
This
->
dscb
->
notify
=
NULL
;
IDirectSoundCaptureBuffer_Release
((
LPDIRECTSOUNDCAPTUREBUFFER
)
This
->
dscb
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
...
...
@@ -839,7 +842,7 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions(
ICOM_THIS
(
IDirectSoundCaptureNotifyImpl
,
iface
);
TRACE
(
"(%p,0x%08lx,%p)
\n
"
,
This
,
howmuch
,
notify
);
if
(
notify
==
NULL
)
{
if
(
howmuch
>
0
&&
notify
==
NULL
)
{
WARN
(
"invalid parameter: notify == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
...
...
@@ -857,7 +860,7 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions(
if
(
hres
!=
DS_OK
)
WARN
(
"IDsDriverNotify_SetNotificationPositions failed
\n
"
);
return
hres
;
}
else
{
}
else
if
(
howmuch
>
0
)
{
/* Make an internal copy of the caller-supplied array.
* Replace the existing copy if one is already present. */
if
(
This
->
dscb
->
notifies
)
...
...
@@ -873,6 +876,12 @@ static HRESULT WINAPI IDirectSoundCaptureNotifyImpl_SetNotificationPositions(
}
memcpy
(
This
->
dscb
->
notifies
,
notify
,
howmuch
*
sizeof
(
DSBPOSITIONNOTIFY
));
This
->
dscb
->
nrofnotifies
=
howmuch
;
}
else
{
if
(
This
->
dscb
->
notifies
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
->
dscb
->
notifies
);
This
->
dscb
->
notifies
=
NULL
;
}
This
->
dscb
->
nrofnotifies
=
0
;
}
return
S_OK
;
...
...
@@ -1361,6 +1370,11 @@ IDirectSoundCaptureBufferImpl_Start(
ipDSC
->
nrofpwaves
*
sizeof
(
WAVEHDR
));
for
(
c
=
0
;
c
<
ipDSC
->
nrofpwaves
;
c
++
)
{
if
(
This
->
notifies
[
c
].
dwOffset
==
DSBPN_OFFSETSTOP
)
{
TRACE
(
"got DSBPN_OFFSETSTOP
\n
"
);
ipDSC
->
nrofpwaves
=
c
;
break
;
}
if
(
c
==
0
)
{
ipDSC
->
pwave
[
0
].
lpData
=
ipDSC
->
buffer
;
ipDSC
->
pwave
[
0
].
dwBufferLength
=
...
...
@@ -1379,6 +1393,7 @@ IDirectSoundCaptureBufferImpl_Start(
err
=
mmErr
(
waveInPrepareHeader
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
c
]),
sizeof
(
WAVEHDR
)));
if
(
err
!=
DS_OK
)
{
WARN
(
"waveInPrepareHeader failed
\n
"
);
while
(
c
--
)
waveInUnprepareHeader
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
c
]),
sizeof
(
WAVEHDR
));
...
...
@@ -1388,6 +1403,7 @@ IDirectSoundCaptureBufferImpl_Start(
err
=
mmErr
(
waveInAddBuffer
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
c
]),
sizeof
(
WAVEHDR
)));
if
(
err
!=
DS_OK
)
{
WARN
(
"waveInAddBuffer failed
\n
"
);
while
(
c
--
)
waveInUnprepareHeader
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
c
]),
sizeof
(
WAVEHDR
));
...
...
@@ -1423,6 +1439,7 @@ IDirectSoundCaptureBufferImpl_Start(
err
=
mmErr
(
waveInAddBuffer
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
0
]),
sizeof
(
WAVEHDR
)));
if
(
err
!=
DS_OK
)
{
WARN
(
"waveInAddBuffer failed
\n
"
);
waveInUnprepareHeader
(
ipDSC
->
hwi
,
&
(
ipDSC
->
pwave
[
0
]),
sizeof
(
WAVEHDR
));
}
...
...
@@ -1435,6 +1452,8 @@ IDirectSoundCaptureBufferImpl_Start(
if
(
err
==
DS_OK
)
{
/* start filling the first buffer */
err
=
mmErr
(
waveInStart
(
ipDSC
->
hwi
));
if
(
err
!=
DS_OK
)
WARN
(
"waveInStart failed
\n
"
);
}
}
...
...
dlls/dsound/dsound_main.c
View file @
dbb03ec6
...
...
@@ -475,7 +475,11 @@ static HRESULT WINAPI IDirectSoundImpl_SetCooperativeLevel(
LPDIRECTSOUND8
iface
,
HWND
hwnd
,
DWORD
level
)
{
ICOM_THIS
(
IDirectSoundImpl
,
iface
);
TRACE
(
"(%p,%08lx,%ld)
\n
"
,
This
,(
DWORD
)
hwnd
,
level
);
TRACE
(
"(%p,%08lx,%ld(%s))
\n
"
,
This
,(
DWORD
)
hwnd
,
level
,
level
==
DSSCL_NORMAL
?
"DSSCL_NORMAL"
:
level
==
DSSCL_PRIORITY
?
"DSSCL_PRIORITY"
:
level
==
DSSCL_EXCLUSIVE
?
"DSSCL_EXCLUSIVE"
:
level
==
DSSCL_WRITEPRIMARY
?
"DSSCL_WRITEPRIMARY"
:
"Unknown"
);
if
(
level
==
DSSCL_PRIORITY
||
level
==
DSSCL_EXCLUSIVE
)
{
FIXME
(
"level=%s not fully supported
\n
"
,
...
...
@@ -506,6 +510,11 @@ static HRESULT WINAPI IDirectSoundImpl_CreateSoundBuffer(
return
DSERR_INVALIDPARAM
;
}
if
(
dsbd
->
dwSize
!=
sizeof
(
DSBUFFERDESC
)
&&
dsbd
->
dwSize
!=
sizeof
(
DSBUFFERDESC1
))
{
WARN
(
"invalid parameter: dsbd
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
ppdsb
==
NULL
)
{
WARN
(
"invalid parameter: ppdsb == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
...
...
include/dsound.h
View file @
dbb03ec6
...
...
@@ -266,6 +266,16 @@ enum
DSFXR_SENDLOOP
};
typedef
struct
_DSBUFFERDESC1
{
DWORD
dwSize
;
DWORD
dwFlags
;
DWORD
dwBufferBytes
;
DWORD
dwReserved
;
LPWAVEFORMATEX
lpwfxFormat
;
}
DSBUFFERDESC1
,
*
LPDSBUFFERDESC1
;
typedef
const
DSBUFFERDESC1
*
LPCDSBUFFERDESC1
;
typedef
struct
_DSBUFFERDESC
{
DWORD
dwSize
;
...
...
@@ -314,13 +324,22 @@ typedef struct _DSCEFFECTDESC
DWORD
dwReserved2
;
}
DSCEFFECTDESC
,
*
LPDSCEFFECTDESC
;
typedef
const
DSCEFFECTDESC
*
LPCDSCEFFECTDESC
;
#define DSCFX_LOCHARDWARE 0x00000001
#define DSCFX_LOCSOFTWARE 0x00000002
#define DSCFXR_LOCHARDWARE 0x00000010
#define DSCFXR_LOCSOFTWARE 0x00000020
typedef
struct
_DSCBUFFERDESC1
{
DWORD
dwSize
;
DWORD
dwFlags
;
DWORD
dwBufferBytes
;
DWORD
dwReserved
;
LPWAVEFORMATEX
lpwfxFormat
;
}
DSCBUFFERDESC1
,
*
LPDSCBUFFERDESC1
;
typedef
struct
_DSCBUFFERDESC
{
DWORD
dwSize
;
...
...
@@ -390,9 +409,9 @@ extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
extern
HRESULT
WINAPI
DirectSoundCreate8
(
LPCGUID
lpGUID
,
LPDIRECTSOUND8
*
ppDS8
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
WINAPI
DirectSoundCaptureCreate8
(
LPCGUID
lpGUID
,
LPDIRECTSOUNDCAPTURE
*
ppDSC8
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
WINAPI
DirectSoundFullDuplexCreate
(
LPCGUID
pcGuidCaptureDevice
,
LPCGUID
pcGuidRenderDevice
,
LPCDSCBUFFERDESC
pcDSCBufferDesc
,
LPCDSBUFFERDESC
pcDSBufferDesc
,
HWND
hWnd
,
DWORD
dwLevel
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
,
LPDIRECTSOUNDCAPTUREBUFFER8
*
ppDSCBuffer8
,
LPDIRECTSOUNDBUFFER8
*
ppDSBuffer8
,
LPUNKNOWN
pUnkOuter
);
extern
HRESULT
WINAPI
DirectSoundFullDuplexCreate
(
LPCGUID
pcGuidCaptureDevice
,
LPCGUID
pcGuidRenderDevice
,
LPCDSCBUFFERDESC
pcDSCBufferDesc
,
LPCDSBUFFERDESC
pcDSBufferDesc
,
HWND
hWnd
,
DWORD
dwLevel
,
LPDIRECTSOUNDFULLDUPLEX
*
ppDSFD
,
LPDIRECTSOUNDCAPTUREBUFFER8
*
ppDSCBuffer8
,
LPDIRECTSOUNDBUFFER8
*
ppDSBuffer8
,
LPUNKNOWN
pUnkOuter
);
#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
extern
HRESULT
WINAPI
GetDeviceID
(
LPCGUID
lpGuidSrc
,
LPGUID
lpGuidDest
);
...
...
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