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
6fecd3d6
Commit
6fecd3d6
authored
Jul 19, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dsound: Merge IDirectSound8 into the main DirectSound object.
parent
db5344e4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
98 deletions
+54
-98
dsound.c
dlls/dsound/dsound.c
+54
-97
dsound_private.h
dlls/dsound/dsound_private.h
+0
-1
No files found.
dlls/dsound/dsound.c
View file @
6fecd3d6
...
...
@@ -52,24 +52,13 @@ struct IDirectSound_IDirectSound {
static
HRESULT
IDirectSound_IDirectSound_Create
(
LPDIRECTSOUND8
pds
,
LPDIRECTSOUND
*
ppds
);
/*****************************************************************************
* IDirectSound8 COM components
*/
struct
IDirectSound8_IDirectSound8
{
const
IDirectSound8Vtbl
*
lpVtbl
;
LONG
ref
;
LPDIRECTSOUND8
pds
;
};
static
HRESULT
IDirectSound8_IDirectSound8_Create
(
LPDIRECTSOUND8
pds
,
LPDIRECTSOUND8
*
ppds
);
typedef
struct
IDirectSoundImpl
{
IUnknown
IUnknown_iface
;
/* Separate refcount, not for COM aggregation */
LONG
ref
,
numIfaces
;
IDirectSound8
IDirectSound8_iface
;
LONG
ref
,
refds
,
numIfaces
;
DirectSoundDevice
*
device
;
BOOL
has_ds8
;
LPDIRECTSOUND
pDS
;
LPDIRECTSOUND8
pDS8
;
}
IDirectSoundImpl
;
static
ULONG
WINAPI
IDirectSound_IDirectSound_AddRef
(
LPDIRECTSOUND
iface
);
...
...
@@ -174,16 +163,8 @@ static HRESULT DSOUND_QueryInterface(
*
ppobj
=
This
->
pDS
;
return
S_OK
;
}
else
if
(
This
->
has_ds8
&&
IsEqualIID
(
riid
,
&
IID_IDirectSound8
))
{
if
(
!
This
->
pDS8
)
{
IDirectSound8_IDirectSound8_Create
(
iface
,
&
This
->
pDS8
);
if
(
!
This
->
pDS8
)
{
WARN
(
"IDirectSound8_IDirectSound8_Create() failed
\n
"
);
*
ppobj
=
NULL
;
return
E_NOINTERFACE
;
}
}
IDirectSound8_AddRef
(
This
->
pDS8
);
*
ppobj
=
This
->
pDS8
;
IDirectSound8_AddRef
(
&
This
->
IDirectSound8_iface
);
*
ppobj
=
&
This
->
IDirectSound8_iface
;
return
S_OK
;
}
...
...
@@ -413,102 +394,111 @@ static HRESULT IDirectSound_IDirectSound_Create(
/*******************************************************************************
* IDirectSound8 Implementation
*/
static
inline
IDirectSoundImpl
*
impl_from_IDirectSound8
(
IDirectSound8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectSoundImpl
,
IDirectSound8_iface
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_QueryInterface
(
IDirectSound8
*
iface
,
REFIID
riid
,
void
**
pp
obj
)
void
**
pp
v
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppobj
);
return
DSOUND_QueryInterface
(
This
->
pds
,
riid
,
ppobj
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,%s,%p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
IUnknown_QueryInterface
(
&
This
->
IUnknown_iface
,
riid
,
ppv
);
}
static
ULONG
WINAPI
IDirectSound8Impl_AddRef
(
IDirectSound8
*
iface
)
{
IDirectSound8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
ULONG
ref
=
InterlockedIncrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
-
1
);
IDirectSoundImpl
*
This
=
impl_from_IDirectSound8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
refds
);
TRACE
(
"(%p) refds=%d
\n
"
,
This
,
ref
);
if
(
ref
==
1
)
InterlockedIncrement
(
&
This
->
numIfaces
);
return
ref
;
}
static
ULONG
WINAPI
IDirectSound8Impl_Release
(
IDirectSound8
*
iface
)
{
IDirectSound8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
ref
));
TRACE
(
"(%p) ref was %d
\n
"
,
This
,
ref
+
1
);
if
(
!
ref
&&
!
InterlockedDecrement
(
&
((
IDirectSoundImpl
*
)
This
->
pds
)
->
numIfaces
))
{
((
IDirectSoundImpl
*
)
This
->
pds
)
->
pDS8
=
NULL
;
directsound_destroy
((
IDirectSoundImpl
*
)
This
->
pds
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
TRACE
(
"(%p) released
\n
"
,
This
);
}
IDirectSoundImpl
*
This
=
impl_from_IDirectSound8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
(
This
->
refds
));
TRACE
(
"(%p) refds=%d
\n
"
,
This
,
ref
);
if
(
!
ref
&&
!
InterlockedDecrement
(
&
This
->
numIfaces
))
directsound_destroy
(
This
);
return
ref
;
}
static
HRESULT
WINAPI
IDirectSound8Impl_CreateSoundBuffer
(
IDirectSound8
*
iface
,
const
DSBUFFERDESC
*
dsbd
,
IDirectSoundBuffer
**
ppdsb
,
IUnknown
*
lpunk
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,%p,%p,%p)
\n
"
,
This
,
dsbd
,
ppdsb
,
lpunk
);
return
DirectSoundDevice_CreateSoundBuffer
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
dsbd
,
ppdsb
,
lpunk
,
TRUE
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,%p,%p,%p)
\n
"
,
This
,
dsbd
,
ppdsb
,
lpunk
);
return
DirectSoundDevice_CreateSoundBuffer
(
This
->
device
,
dsbd
,
ppdsb
,
lpunk
,
TRUE
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_GetCaps
(
IDirectSound8
*
iface
,
DSCAPS
*
lpDSCaps
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,%p)
\n
"
,
This
,
lpDSCaps
);
return
DirectSoundDevice_GetCaps
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
lpDSCaps
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,%p)
\n
"
,
This
,
lpDSCaps
);
return
DirectSoundDevice_GetCaps
(
This
->
device
,
lpDSCaps
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_DuplicateSoundBuffer
(
IDirectSound8
*
iface
,
IDirectSoundBuffer
*
psb
,
IDirectSoundBuffer
**
ppdsb
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,%p,%p)
\n
"
,
This
,
psb
,
ppdsb
);
return
DirectSoundDevice_DuplicateSoundBuffer
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
psb
,
ppdsb
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,%p,%p)
\n
"
,
This
,
psb
,
ppdsb
);
return
DirectSoundDevice_DuplicateSoundBuffer
(
This
->
device
,
psb
,
ppdsb
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_SetCooperativeLevel
(
IDirectSound8
*
iface
,
HWND
hwnd
,
DWORD
level
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,%p,%s)
\n
"
,
This
,
hwnd
,
dumpCooperativeLevel
(
level
));
return
DirectSoundDevice_SetCooperativeLevel
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
hwnd
,
level
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,%p,%s)
\n
"
,
This
,
hwnd
,
dumpCooperativeLevel
(
level
));
return
DirectSoundDevice_SetCooperativeLevel
(
This
->
device
,
hwnd
,
level
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_Compact
(
IDirectSound8
*
iface
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p)
\n
"
,
This
);
return
DirectSoundDevice_Compact
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
);
return
DirectSoundDevice_Compact
(
This
->
device
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_GetSpeakerConfig
(
IDirectSound8
*
iface
,
DWORD
*
lpdwSpeakerConfig
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
lpdwSpeakerConfig
);
return
DirectSoundDevice_GetSpeakerConfig
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
lpdwSpeakerConfig
);
return
DirectSoundDevice_GetSpeakerConfig
(
This
->
device
,
lpdwSpeakerConfig
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_SetSpeakerConfig
(
IDirectSound8
*
iface
,
DWORD
config
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
TRACE
(
"(%p,0x%08x)
\n
"
,
This
,
config
);
return
DirectSoundDevice_SetSpeakerConfig
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
config
);
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p,0x%08x)
\n
"
,
This
,
config
);
return
DirectSoundDevice_SetSpeakerConfig
(
This
->
device
,
config
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_Initialize
(
IDirectSound8
*
iface
,
const
GUID
*
lpcGuid
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p, %s)
\n
"
,
This
,
debugstr_guid
(
lpcGuid
));
return
DirectSoundDevice_Initialize
(
&
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
lpcGuid
);
return
DirectSoundDevice_Initialize
(
&
This
->
device
,
lpcGuid
);
}
static
HRESULT
WINAPI
IDirectSound8Impl_VerifyCertification
(
IDirectSound8
*
iface
,
DWORD
*
pdwCertified
)
{
IDirectSound
8_IDirectSound8
*
This
=
(
IDirectSound8_IDirectSound8
*
)
iface
;
IDirectSound
Impl
*
This
=
impl_from_IDirectSound8
(
iface
)
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
pdwCertified
);
return
DirectSoundDevice_VerifyCertification
(
((
IDirectSoundImpl
*
)
This
->
pds
)
->
device
,
pdwCertified
);
return
DirectSoundDevice_VerifyCertification
(
This
->
device
,
pdwCertified
);
}
static
const
IDirectSound8Vtbl
ds8_vtbl
=
...
...
@@ -527,41 +517,6 @@ static const IDirectSound8Vtbl ds8_vtbl =
IDirectSound8Impl_VerifyCertification
};
static
HRESULT
IDirectSound8_IDirectSound8_Create
(
LPDIRECTSOUND8
pds
,
LPDIRECTSOUND8
*
ppds
)
{
IDirectSound8_IDirectSound8
*
pdsds
;
TRACE
(
"(%p,%p)
\n
"
,
pds
,
ppds
);
if
(
ppds
==
NULL
)
{
ERR
(
"invalid parameter: ppds == NULL
\n
"
);
return
DSERR_INVALIDPARAM
;
}
if
(
pds
==
NULL
)
{
ERR
(
"invalid parameter: pds == NULL
\n
"
);
*
ppds
=
NULL
;
return
DSERR_INVALIDPARAM
;
}
pdsds
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
pdsds
));
if
(
pdsds
==
NULL
)
{
WARN
(
"out of memory
\n
"
);
*
ppds
=
NULL
;
return
DSERR_OUTOFMEMORY
;
}
pdsds
->
lpVtbl
=
&
ds8_vtbl
;
pdsds
->
ref
=
0
;
pdsds
->
pds
=
pds
;
InterlockedIncrement
(
&
((
IDirectSoundImpl
*
)
pds
)
->
numIfaces
);
*
ppds
=
(
LPDIRECTSOUND8
)
pdsds
;
return
DS_OK
;
}
static
HRESULT
IDirectSoundImpl_Create
(
REFIID
riid
,
void
**
ppv
,
BOOL
has_ds8
)
{
IDirectSoundImpl
*
obj
;
...
...
@@ -579,7 +534,9 @@ static HRESULT IDirectSoundImpl_Create(REFIID riid, void **ppv, BOOL has_ds8)
setup_dsound_options
();
obj
->
IUnknown_iface
.
lpVtbl
=
&
unk_vtbl
;
obj
->
IDirectSound8_iface
.
lpVtbl
=
&
ds8_vtbl
;
obj
->
ref
=
1
;
obj
->
refds
=
0
;
obj
->
numIfaces
=
1
;
obj
->
device
=
NULL
;
obj
->
has_ds8
=
has_ds8
;
...
...
dlls/dsound/dsound_private.h
View file @
6fecd3d6
...
...
@@ -40,7 +40,6 @@ extern int ds_default_bits_per_sample DECLSPEC_HIDDEN;
* Predeclare the interface implementation structures
*/
typedef
struct
IDirectSound_IDirectSound
IDirectSound_IDirectSound
;
typedef
struct
IDirectSound8_IDirectSound8
IDirectSound8_IDirectSound8
;
typedef
struct
IDirectSoundBufferImpl
IDirectSoundBufferImpl
;
typedef
struct
IDirectSoundCaptureImpl
IDirectSoundCaptureImpl
;
typedef
struct
IDirectSoundCaptureBufferImpl
IDirectSoundCaptureBufferImpl
;
...
...
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