Signed-off-by: Anton Romanov theli.ua@gmail.com --- dlls/wmp/player.c | 219 ++++++++++++++++++++++++++++++++++++++++++++++++- dlls/wmp/wmp_private.h | 2 + 2 files changed, 219 insertions(+), 2 deletions(-)
diff --git a/dlls/wmp/player.c b/dlls/wmp/player.c index 430f701539..c15a79e2d0 100644 --- a/dlls/wmp/player.c +++ b/dlls/wmp/player.c @@ -24,6 +24,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmp);
static void update_state(WindowsMediaPlayer *wmp, int state);
+static inline WindowsMediaPlayer *impl_from_IWMPMedia(IWMPMedia *iface) +{ + return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPMedia_iface); +} + static inline WindowsMediaPlayer *impl_from_IWMPPlayer4(IWMPPlayer4 *iface) { return CONTAINING_RECORD(iface, WindowsMediaPlayer, IWMPPlayer4_iface); @@ -145,8 +150,10 @@ static HRESULT WINAPI WMPPlayer4_get_settings(IWMPPlayer4 *iface, IWMPSettings * static HRESULT WINAPI WMPPlayer4_get_currentMedia(IWMPPlayer4 *iface, IWMPMedia **ppMedia) { WindowsMediaPlayer *This = impl_from_IWMPPlayer4(iface); - FIXME("(%p)->(%p)\n", This, ppMedia); - return E_NOTIMPL; + TRACE("(%p)->(%p)\n", This, ppMedia); + IWMPMedia_AddRef(&This->IWMPMedia_iface); + *ppMedia = &This->IWMPMedia_iface; + return S_OK; }
static HRESULT WINAPI WMPPlayer4_put_currentMedia(IWMPPlayer4 *iface, IWMPMedia *pMedia) @@ -865,10 +872,218 @@ static const IWMPControlsVtbl WMPControlsVtbl = { WMPControls_playItem, };
+HRESULT WINAPI WMPMedia_get_isIdentical(IWMPMedia *iface, IWMPMedia *other, VARIANT_BOOL *pvBool) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p, %p)\n", This, other, pvBool); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_sourceURL(IWMPMedia *iface, BSTR *pbstrName) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pbstrName); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_name(IWMPMedia *iface, BSTR *pbstrName) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pbstrName); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_put_name(IWMPMedia *iface, BSTR pbstrName) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(pbstrName)); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_imageSourceWidth(IWMPMedia *iface, LONG *pWidth) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pWidth); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_imageSourceHeight(IWMPMedia *iface, LONG *pHeight) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pHeight); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_markerCount(IWMPMedia *iface, LONG* pMarkerCount) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pMarkerCount); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_getMarkerTime(IWMPMedia *iface, LONG MarkerNum, DOUBLE *pMarkerTime) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%d, %p)\n", This, MarkerNum, pMarkerTime); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_getMarkerName(IWMPMedia *iface, LONG MarkerNum, BSTR *pbstrMarkerName) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%d, %p)\n", This, MarkerNum, pbstrMarkerName); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_duration(IWMPMedia *iface, DOUBLE *pDuration) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pDuration); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_durationString(IWMPMedia *iface, BSTR *pbstrDuration) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pbstrDuration); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_get_attributeCount(IWMPMedia *iface, LONG *plCount) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, plCount); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_getAttributeName(IWMPMedia *iface, LONG lIndex, BSTR *pbstrItemName) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%d, %p)\n", This, lIndex, pbstrItemName); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_getItemInfo(IWMPMedia *iface, BSTR bstrItemName, BSTR *pbstrVal) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%s, %p)\n", This, debugstr_w(bstrItemName), pbstrVal); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_setItemInfo(IWMPMedia *iface, BSTR bstrItemName, BSTR bstrVal) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%s, %s)\n", This, debugstr_w(bstrItemName), debugstr_w(bstrVal)); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_getItemInfoByAtom(IWMPMedia *iface, LONG lAtom, BSTR *pbstrVal) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%d, %p)\n", This, lAtom, pbstrVal); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_isMemberOf(IWMPMedia *iface, IWMPPlaylist *pPlaylist, VARIANT_BOOL *pvarfIsMemberOf) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p, %p)\n", This, pPlaylist, pvarfIsMemberOf); + return E_NOTIMPL; +} + +HRESULT WINAPI WMPMedia_isReadOnlyItem(IWMPMedia *iface, BSTR bstrItemName, VARIANT_BOOL *pvarfIsReadOnly) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%s, %p)\n", This, debugstr_w(bstrItemName), pvarfIsReadOnly); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPMedia_QueryInterface(IWMPMedia *iface, REFIID riid, void **ppv) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + return IOleObject_QueryInterface(&This->IOleObject_iface, riid, ppv); +} + +static ULONG WINAPI WMPMedia_AddRef(IWMPMedia *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + return IOleObject_AddRef(&This->IOleObject_iface); +} + +static ULONG WINAPI WMPMedia_Release(IWMPMedia *iface) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + return IOleObject_Release(&This->IOleObject_iface); +} + +static HRESULT WINAPI WMPMedia_GetTypeInfoCount(IWMPMedia *iface, UINT *pctinfo) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%p)\n", This, pctinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPMedia_GetTypeInfo(IWMPMedia *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPMedia_GetIDsOfNames(IWMPMedia *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(iface); + FIXME("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMPMedia_Invoke(IWMPMedia *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, + EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + WindowsMediaPlayer *This = impl_from_IWMPMedia(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 const IWMPMediaVtbl WMPMediaVtbl = { + WMPMedia_QueryInterface, + WMPMedia_AddRef, + WMPMedia_Release, + WMPMedia_GetTypeInfoCount, + WMPMedia_GetTypeInfo, + WMPMedia_GetIDsOfNames, + WMPMedia_Invoke, + WMPMedia_get_isIdentical, + WMPMedia_get_sourceURL, + WMPMedia_get_name, + WMPMedia_put_name, + WMPMedia_get_imageSourceWidth, + WMPMedia_get_imageSourceHeight, + WMPMedia_get_markerCount, + WMPMedia_getMarkerTime, + WMPMedia_getMarkerName, + WMPMedia_get_duration, + WMPMedia_get_durationString, + WMPMedia_get_attributeCount, + WMPMedia_getAttributeName, + WMPMedia_getItemInfo, + WMPMedia_setItemInfo, + WMPMedia_getItemInfoByAtom, + WMPMedia_isMemberOf, + WMPMedia_isReadOnlyItem +}; + HRESULT init_player(WindowsMediaPlayer *wmp) { wmp->IWMPPlayer4_iface.lpVtbl = &WMPPlayer4Vtbl; wmp->IWMPSettings_iface.lpVtbl = &WMPSettingsVtbl; wmp->IWMPControls_iface.lpVtbl = &WMPControlsVtbl; + wmp->IWMPMedia_iface.lpVtbl = &WMPMediaVtbl; + return S_OK; } diff --git a/dlls/wmp/wmp_private.h b/dlls/wmp/wmp_private.h index 003eef8015..cb8a408b7f 100644 --- a/dlls/wmp/wmp_private.h +++ b/dlls/wmp/wmp_private.h @@ -44,6 +44,8 @@ struct WindowsMediaPlayer { IWMPPlayer4 IWMPPlayer4_iface; IWMPSettings IWMPSettings_iface; IWMPControls IWMPControls_iface; + /* For now there is only one IWMPMedia at a time */ + IWMPMedia IWMPMedia_iface;
LONG ref;