dmsynth: Implement the sink Init method.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7bc708df35
commit
83064d1500
|
@ -77,6 +77,7 @@ struct IDirectMusicSynthSinkImpl {
|
||||||
LONG ref;
|
LONG ref;
|
||||||
IReferenceClock *latency_clock;
|
IReferenceClock *latency_clock;
|
||||||
IReferenceClock *master_clock;
|
IReferenceClock *master_clock;
|
||||||
|
IDirectMusicSynth *synth; /* No reference hold! */
|
||||||
BOOL active;
|
BOOL active;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,11 @@ static HRESULT WINAPI IDirectMusicSynthSinkImpl_Init(IDirectMusicSynthSink *ifac
|
||||||
{
|
{
|
||||||
IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface);
|
IDirectMusicSynthSinkImpl *This = impl_from_IDirectMusicSynthSink(iface);
|
||||||
|
|
||||||
FIXME("(%p)->(%p): stub\n", This, synth);
|
TRACE("(%p)->(%p)\n", This, synth);
|
||||||
|
|
||||||
|
/* Not holding a reference to avoid circular dependencies.
|
||||||
|
The synth will release the sink during the synth's destruction. */
|
||||||
|
This->synth = synth;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,6 +131,8 @@ static void test_dmsynth(void)
|
||||||
ref_clock_sink = get_refcount(clock_sink);
|
ref_clock_sink = get_refcount(clock_sink);
|
||||||
|
|
||||||
/* This will Init() the SynthSink and finish initializing the Synth */
|
/* This will Init() the SynthSink and finish initializing the Synth */
|
||||||
|
hr = IDirectMusicSynthSink_Init(dmsynth_sink2, NULL);
|
||||||
|
ok(hr == S_OK, "IDirectMusicSynthSink_Init returned: %x\n", hr);
|
||||||
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2);
|
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink2);
|
||||||
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
|
ok(hr == S_OK, "IDirectMusicSynth_SetSynthSink returned: %x\n", hr);
|
||||||
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
|
hr = IDirectMusicSynth_SetSynthSink(dmsynth, dmsynth_sink);
|
||||||
|
|
|
@ -195,10 +195,10 @@ static ULONG WINAPI synth_port_Release(IDirectMusicPort *iface)
|
||||||
if (!ref)
|
if (!ref)
|
||||||
{
|
{
|
||||||
dmusic_remove_port(This->parent, iface);
|
dmusic_remove_port(This->parent, iface);
|
||||||
|
IDirectMusicSynthSink_Release(This->synth_sink);
|
||||||
IDirectMusicSynth_Activate(This->synth, FALSE);
|
IDirectMusicSynth_Activate(This->synth, FALSE);
|
||||||
IDirectMusicSynth_Close(This->synth);
|
IDirectMusicSynth_Close(This->synth);
|
||||||
IDirectMusicSynth_Release(This->synth);
|
IDirectMusicSynth_Release(This->synth);
|
||||||
IDirectMusicSynthSink_Release(This->synth_sink);
|
|
||||||
if (This->dsbuffer)
|
if (This->dsbuffer)
|
||||||
IDirectSoundBuffer_Release(This->dsbuffer);
|
IDirectSoundBuffer_Release(This->dsbuffer);
|
||||||
if (This->dsound)
|
if (This->dsound)
|
||||||
|
|
Loading…
Reference in New Issue