dmsynth: Activate the sink from the synth Activate() method.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3292bc2965
commit
5d687a23e4
|
@ -63,7 +63,7 @@ struct IDirectMusicSynth8Impl {
|
||||||
|
|
||||||
/* IDirectMusicSynth8 fields */
|
/* IDirectMusicSynth8 fields */
|
||||||
DMUS_PORTCAPS pCaps;
|
DMUS_PORTCAPS pCaps;
|
||||||
BOOL fActive;
|
BOOL active;
|
||||||
IReferenceClock* pLatencyClock;
|
IReferenceClock* pLatencyClock;
|
||||||
IDirectMusicSynthSink *sink;
|
IDirectMusicSynthSink *sink;
|
||||||
};
|
};
|
||||||
|
|
|
@ -332,10 +332,28 @@ static HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock(IDirectMusicSynth8
|
||||||
static HRESULT WINAPI IDirectMusicSynth8Impl_Activate(IDirectMusicSynth8 *iface, BOOL enable)
|
static HRESULT WINAPI IDirectMusicSynth8Impl_Activate(IDirectMusicSynth8 *iface, BOOL enable)
|
||||||
{
|
{
|
||||||
IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface);
|
IDirectMusicSynth8Impl *This = impl_from_IDirectMusicSynth8(iface);
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("(%p)->(%d)\n", This, enable);
|
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;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ static void test_dmsynth(void)
|
||||||
|
|
||||||
/* Synth isn't fully initialized yet */
|
/* Synth isn't fully initialized yet */
|
||||||
hr = IDirectMusicSynth_Activate(dmsynth, TRUE);
|
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 */
|
/* Synth has no default clock */
|
||||||
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
|
hr = IDirectMusicSynth_GetLatencyClock(dmsynth, &clock_synth);
|
||||||
|
|
Loading…
Reference in New Issue