Commit 5d687a23 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

dmsynth: Activate the sink from the synth Activate() method.

parent 3292bc29
......@@ -63,7 +63,7 @@ struct IDirectMusicSynth8Impl {
/* IDirectMusicSynth8 fields */
DMUS_PORTCAPS pCaps;
BOOL fActive;
BOOL active;
IReferenceClock* pLatencyClock;
IDirectMusicSynthSink *sink;
};
......
......@@ -332,10 +332,28 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock(IDirectMusicSynth8
static HRESULT WINAPI IDirectMusicSynth8Impl_Activate(IDirectMusicSynth8 *iface, BOOL enable)
{
IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface);
HRESULT hr;
TRACE("(%p)->(%d)\n", This, enable);
This->fActive = enable;
if (!This->sink)
return DMUS_E_NOSYNTHSINK;
if (enable == This->active) {
if (enable)
return DMUS_E_SYNTHACTIVE;
else
return S_FALSE;
}
if ((hr = IDirectMusicSynthSink_Activate(This->sink, enable)) != S_OK) {
if (hr == DMUS_E_SYNTHACTIVE || hr == S_FALSE)
WARN("Synth and sink active state out of sync. Fixing.\n");
else
return hr;
}
This->active = enable;
return S_OK;
}
......
......@@ -114,7 +114,7 @@ static void test_dmsynth(void)
/* Synth isn't fully initialized yet */
hr = IDirectMusicSynth_Activate(dmsynth, TRUE);
todo_wine ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %x\n", hr);
ok(hr == DMUS_E_NOSYNTHSINK, "IDirectMusicSynth_Activate returned: %x\n", hr);
/* Synth has no default clock */
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment