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
f968edb9
Commit
f968edb9
authored
May 10, 2017
by
Michael Stefaniuc
Committed by
Alexandre Julliard
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Partially implement the synth IDirectMusicPort::SetDirectSound().
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e8873b75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
16 deletions
+43
-16
port.c
dlls/dmusic/port.c
+34
-7
dmusic.c
dlls/dmusic/tests/dmusic.c
+9
-9
No files found.
dlls/dmusic/port.c
View file @
f968edb9
...
...
@@ -31,11 +31,12 @@ typedef struct SynthPortImpl {
IKsControl
IKsControl_iface
;
LONG
ref
;
IDirectMusic8Impl
*
parent
;
IDirectSound
*
pDirectSound
;
IDirectSound
*
dsound
;
IDirectSoundBuffer
*
dsbuffer
;
IReferenceClock
*
pLatencyClock
;
IDirectMusicSynth
*
synth
;
IDirectMusicSynthSink
*
synth_sink
;
BOOL
fA
ctive
;
BOOL
a
ctive
;
DMUS_PORTCAPS
caps
;
DMUS_PORTPARAMS
params
;
int
nrofgroups
;
...
...
@@ -198,6 +199,10 @@ static ULONG WINAPI SynthPortImpl_IDirectMusicPort_Release(LPDIRECTMUSICPORT ifa
IDirectMusicSynth_Release
(
This
->
synth
);
IDirectMusicSynthSink_Release
(
This
->
synth_sink
);
IReferenceClock_Release
(
This
->
pLatencyClock
);
if
(
This
->
dsbuffer
)
IDirectSoundBuffer_Release
(
This
->
dsbuffer
);
if
(
This
->
dsound
)
IDirectSound_Release
(
This
->
dsound
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
@@ -437,7 +442,7 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_Activate(LPDIRECTMUSICPORT
TRACE
(
"(%p/%p)->(%d)
\n
"
,
iface
,
This
,
active
);
This
->
fA
ctive
=
active
;
This
->
a
ctive
=
active
;
return
S_OK
;
}
...
...
@@ -468,11 +473,33 @@ static HRESULT WINAPI SynthPortImpl_IDirectMusicPort_GetChannelPriority(LPDIRECT
return
S_OK
;
}
static
HRESULT
WINAPI
SynthPortImpl_IDirectMusicPort_SetDirectSound
(
LPDIRECTMUSICPORT
iface
,
LPDIRECTSOUND
direct_sound
,
LPDIRECTSOUNDBUFFER
direct_sound_buffer
)
static
HRESULT
WINAPI
synth_dmport_SetDirectSound
(
IDirectMusicPort
*
iface
,
IDirectSound
*
dsound
,
IDirectSoundBuffer
*
dsbuffer
)
{
SynthPortImpl
*
This
=
impl_from_SynthPortImpl_IDirectMusicPort
(
iface
);
FIXME
(
"(%p/%p)->(%p, %p): stub
\n
"
,
iface
,
This
,
direct_sound
,
direct_sound_buffer
);
FIXME
(
"(%p/%p)->(%p, %p): semi-stub
\n
"
,
iface
,
This
,
dsound
,
dsbuffer
);
if
(
This
->
active
)
return
DMUS_E_DSOUND_ALREADY_SET
;
if
(
This
->
dsound
)
{
if
(
This
->
dsound
!=
This
->
parent
->
dsound
)
ERR
(
"Not the same dsound in the port (%p) and parent dmusic (%p), expect trouble!
\n
"
,
This
->
dsound
,
This
->
parent
->
dsound
);
if
(
!
IDirectSound_Release
(
This
->
parent
->
dsound
))
This
->
parent
->
dsound
=
NULL
;
}
if
(
This
->
dsbuffer
)
IDirectSound_Release
(
This
->
dsbuffer
);
This
->
dsound
=
dsound
;
This
->
dsbuffer
=
dsbuffer
;
if
(
This
->
dsound
)
IDirectSound_AddRef
(
This
->
dsound
);
if
(
This
->
dsbuffer
)
IDirectSound_AddRef
(
This
->
dsbuffer
);
return
S_OK
;
}
...
...
@@ -543,7 +570,7 @@ static const IDirectMusicPortVtbl SynthPortImpl_DirectMusicPort_Vtbl = {
SynthPortImpl_IDirectMusicPort_Activate
,
SynthPortImpl_IDirectMusicPort_SetChannelPriority
,
SynthPortImpl_IDirectMusicPort_GetChannelPriority
,
SynthPortImpl_IDirectMusicP
ort_SetDirectSound
,
synth_dmp
ort_SetDirectSound
,
SynthPortImpl_IDirectMusicPort_GetFormat
};
...
...
@@ -785,7 +812,7 @@ HRESULT synth_port_create(IDirectMusic8Impl *parent, DMUS_PORTPARAMS *port_param
obj
->
IKsControl_iface
.
lpVtbl
=
&
ikscontrol_vtbl
;
obj
->
ref
=
1
;
obj
->
parent
=
parent
;
obj
->
fA
ctive
=
FALSE
;
obj
->
a
ctive
=
FALSE
;
obj
->
params
=
*
port_params
;
obj
->
caps
=
*
port_caps
;
...
...
dlls/dmusic/tests/dmusic.c
View file @
f968edb9
...
...
@@ -183,11 +183,11 @@ static void test_setdsound(void)
/* Releasing dsound from dmusic */
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
DMUS_E_DSOUND_ALREADY_SET
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ok
(
hr
==
DMUS_E_DSOUND_ALREADY_SET
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
hr
=
IDirectMusicPort_Activate
(
port
,
FALSE
);
ok
(
hr
==
S_OK
,
"Port Activate returned: %x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
hr
=
IDirectMusic_SetDirectSound
(
dmusic
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
...
...
@@ -217,41 +217,41 @@ static void test_setdsound(void)
hr
=
IDirectMusicPort_SetDirectSound
(
port
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
ok
(
ref
==
2
,
"dsound ref count got %d expected 2
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
/* Setting the dsound again on the port will mess with the parent dmusic */
hr
=
IDirectMusicPort_SetDirectSound
(
port
,
dsound
,
NULL
);
ok
(
hr
==
S_OK
,
"SetDirectSound failed: %08x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
1
,
"dsound2 ref count got %d expected 1
\n
"
,
ref
);
ok
(
ref
==
1
,
"dsound2 ref count got %d expected 1
\n
"
,
ref
);
IDirectSound_AddRef
(
dsound2
);
/* Crash prevention */
hr
=
IDirectMusicPort_Activate
(
port
,
TRUE
);
ok
(
hr
==
S_OK
,
"Activate returned: %x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
4
,
"dsound ref count got %d expected 4
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
hr
=
IDirectMusicPort_Activate
(
port
,
TRUE
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Activate returned: %x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
4
,
"dsound ref count got %d expected 4
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
ok
(
ref
==
2
,
"dsound2 ref count got %d expected 2
\n
"
,
ref
);
/* Deactivating the port messes with the dsound refcount in the parent dmusic */
hr
=
IDirectMusicPort_Activate
(
port
,
FALSE
);
ok
(
hr
==
S_OK
,
"Port Activate returned: %x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
1
,
"dsound2 ref count got %d expected 1
\n
"
,
ref
);
hr
=
IDirectMusicPort_Activate
(
port
,
FALSE
);
todo_wine
ok
(
hr
==
S_FALSE
,
"Port Activate returned: %x
\n
"
,
hr
);
ref
=
get_refcount
(
dsound
);
todo_wine
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ok
(
ref
==
3
,
"dsound ref count got %d expected 3
\n
"
,
ref
);
ref
=
get_refcount
(
dsound2
);
todo_wine
ok
(
ref
==
1
,
"dsound2 ref count got %d expected 1
\n
"
,
ref
);
...
...
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