wmp: Added IWMPPlayer4::get_settings implementation.

This commit is contained in:
Jacek Caban 2014-02-26 12:07:15 +01:00 committed by Alexandre Julliard
parent b61c63af56
commit fea6fedf29
4 changed files with 286 additions and 2 deletions

View File

@ -261,6 +261,9 @@ static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, v
}else if(IsEqualGUID(riid, &IID_IWMPPlayer4)) {
TRACE("(%p)->(IID_IWMPPlayer4 %p)\n", This, ppv);
*ppv = &This->IWMPPlayer4_iface;
}else if(IsEqualGUID(riid, &IID_IWMPSettings)) {
TRACE("(%p)->(IID_IWMPSettings %p)\n", This, ppv);
*ppv = &This->IWMPSettings_iface;
}else if(IsEqualGUID(riid, &IID_IOleControl)) {
TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
*ppv = &This->IOleControl_iface;

View File

@ -123,8 +123,12 @@ static HRESULT WINAPI WMPPlayer4_get_controls(IWMPPlayer4 *iface, IWMPControls *
static HRESULT WINAPI WMPPlayer4_get_settings(IWMPPlayer4 *iface, IWMPSettings **ppSettings)
{
WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface);
FIXME("(%p)->(%p)\n", This, ppSettings);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, ppSettings);
IWMPSettings_AddRef(&This->IWMPSettings_iface);
*ppSettings = &This->IWMPSettings_iface;
return S_OK;
}
static HRESULT WINAPI WMPPlayer4_get_currentMedia(IWMPPlayer4 *iface, IWMPMedia **ppMedia)
@ -400,7 +404,258 @@ static IWMPPlayer4Vtbl WMPPlayer4Vtbl = {
WMPPlayer4_openPlayer
};
static inline WindowsMediaPlayer *impl_from_IWMPSettings(IWMPSettings *iface)
{
return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPSettings_iface);
}
static HRESULT WINAPI WMPSettings_QueryInterface(IWMPSettings *iface, REFIID riid, void **ppv)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
return IOleObject_QueryInterface(&This->IOleObject_iface, riid, ppv);
}
static ULONG WINAPI WMPSettings_AddRef(IWMPSettings *iface)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
return IOleObject_AddRef(&This->IOleObject_iface);
}
static ULONG WINAPI WMPSettings_Release(IWMPSettings *iface)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
return IOleObject_Release(&This->IOleObject_iface);
}
static HRESULT WINAPI WMPSettings_GetTypeInfoCount(IWMPSettings *iface, UINT *pctinfo)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_GetTypeInfo(IWMPSettings *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_GetIDsOfNames(IWMPSettings *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_Invoke(IWMPSettings *iface, DISPID dispIdMember,
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult,
EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%d %s %d %x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_isAvailable(IWMPSettings *iface, BSTR item, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(item), p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_autoStart(IWMPSettings *iface, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_autoStart(IWMPSettings *iface, VARIANT_BOOL v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_baseURL(IWMPSettings *iface, BSTR *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_baseURL(IWMPSettings *iface, BSTR v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_defaultFrame(IWMPSettings *iface, BSTR *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_defaultFrame(IWMPSettings *iface, BSTR v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_invokeURLs(IWMPSettings *iface, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_invokeURLs(IWMPSettings *iface, VARIANT_BOOL v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_mute(IWMPSettings *iface, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_mute(IWMPSettings *iface, VARIANT_BOOL v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_playCount(IWMPSettings *iface, LONG *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_playCount(IWMPSettings *iface, LONG v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%d)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_rate(IWMPSettings *iface, double *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_rate(IWMPSettings *iface, double v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%lf)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_balance(IWMPSettings *iface, LONG *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_balance(IWMPSettings *iface, LONG v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%d)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_volume(IWMPSettings *iface, LONG *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_volume(IWMPSettings *iface, LONG v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%d)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_getMode(IWMPSettings *iface, BSTR mode, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s %p)\n", This, debugstr_w(mode), p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_setMode(IWMPSettings *iface, BSTR mode, VARIANT_BOOL v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%s %x)\n", This, debugstr_w(mode), v);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_get_enableErrorDialogs(IWMPSettings *iface, VARIANT_BOOL *p)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI WMPSettings_put_enableErrorDialogs(IWMPSettings *iface, VARIANT_BOOL v)
{
WindowsMediaPlayer *This = impl_from_IWMPSettings(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static const IWMPSettingsVtbl WMPSettingsVtbl = {
WMPSettings_QueryInterface,
WMPSettings_AddRef,
WMPSettings_Release,
WMPSettings_GetTypeInfoCount,
WMPSettings_GetTypeInfo,
WMPSettings_GetIDsOfNames,
WMPSettings_Invoke,
WMPSettings_get_isAvailable,
WMPSettings_get_autoStart,
WMPSettings_put_autoStart,
WMPSettings_get_baseURL,
WMPSettings_put_baseURL,
WMPSettings_get_defaultFrame,
WMPSettings_put_defaultFrame,
WMPSettings_get_invokeURLs,
WMPSettings_put_invokeURLs,
WMPSettings_get_mute,
WMPSettings_put_mute,
WMPSettings_get_playCount,
WMPSettings_put_playCount,
WMPSettings_get_rate,
WMPSettings_put_rate,
WMPSettings_get_balance,
WMPSettings_put_balance,
WMPSettings_get_volume,
WMPSettings_put_volume,
WMPSettings_getMode,
WMPSettings_setMode,
WMPSettings_get_enableErrorDialogs,
WMPSettings_put_enableErrorDialogs
};
void init_player_ifaces(WindowsMediaPlayer *wmp)
{
wmp->IWMPPlayer4_iface.lpVtbl = &WMPPlayer4Vtbl;
wmp->IWMPSettings_iface.lpVtbl = &WMPSettingsVtbl;
}

View File

@ -788,6 +788,29 @@ static HRESULT cs_qi(REFIID riid, void **ppv)
return S_OK;
}
static void test_wmp_ifaces(IOleObject *oleobj)
{
IWMPSettings *settings, *settings_qi;
IWMPPlayer4 *player4;
HRESULT hres;
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPPlayer4, (void**)&player4);
ok(hres == S_OK, "Could not get IWMPPlayer4 iface: %08x\n", hres);
settings = NULL;
hres = IWMPPlayer4_get_settings(player4, &settings);
ok(hres == S_OK, "get_settings failed: %08x\n", hres);
ok(settings != NULL, "settings = NULL\n");
hres = IOleObject_QueryInterface(oleobj, &IID_IWMPSettings, (void**)&settings_qi);
ok(hres == S_OK, "Could not get IWMPSettings iface: %08x\n", hres);
ok(settings == settings_qi, "settings != settings_qi\n");
IWMPSettings_Release(settings_qi);
IWMPSettings_Release(settings);
IWMPPlayer4_Release(player4);
}
#define test_rect_size(a,b,c) _test_rect_size(__LINE__,a,b,c)
static void _test_rect_size(unsigned line, const RECT *r, int width, int height)
{
@ -935,6 +958,8 @@ static void test_wmp(void)
GetClientRect(hwnd, &pos);
test_rect_size(&pos, 300, 310);
test_wmp_ifaces(oleobj);
hres = IOleObject_DoVerb(oleobj, OLEIVERB_HIDE, NULL, &ClientSite, 0, container_hwnd, &pos);
ok(hres == S_OK, "DoVerb failed: %08x\n", hres);
ok(!IsWindowVisible(hwnd), "Window is visible\n");

View File

@ -30,6 +30,7 @@ struct WindowsMediaPlayer {
IConnectionPointContainer IConnectionPointContainer_iface;
IOleControl IOleControl_iface;
IWMPPlayer4 IWMPPlayer4_iface;
IWMPSettings IWMPSettings_iface;
LONG ref;