Commit 29ffed20 authored by Mohamad Al-Jaf's avatar Mohamad Al-Jaf Committed by Alexandre Julliard

windows.media.mediacontrol: Implement ISystemMediaTransportControlsDisplayUpdater::get/put_Type().

Called by Roon.
parent c1ae95fb
......@@ -121,6 +121,8 @@ struct display_updater
{
ISystemMediaTransportControlsDisplayUpdater ISystemMediaTransportControlsDisplayUpdater_iface;
LONG ref;
MediaPlaybackType playback_type;
};
static inline struct display_updater *impl_from_ISystemMediaTransportControlsDisplayUpdater( ISystemMediaTransportControlsDisplayUpdater *iface )
......@@ -188,14 +190,23 @@ static HRESULT WINAPI display_updater_GetTrustLevel( ISystemMediaTransportContro
static HRESULT WINAPI display_updater_get_Type( ISystemMediaTransportControlsDisplayUpdater *iface, MediaPlaybackType *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct display_updater *impl = impl_from_ISystemMediaTransportControlsDisplayUpdater( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->playback_type;
return S_OK;
}
static HRESULT WINAPI display_updater_put_Type( ISystemMediaTransportControlsDisplayUpdater *iface, MediaPlaybackType value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct display_updater *impl = impl_from_ISystemMediaTransportControlsDisplayUpdater( iface );
TRACE( "iface %p, value %d\n", iface, value );
if (value < MediaPlaybackType_Unknown || value > MediaPlaybackType_Image) return E_INVALIDARG;
impl->playback_type = value;
return S_OK;
}
static HRESULT WINAPI display_updater_get_AppMediaId( ISystemMediaTransportControlsDisplayUpdater *iface, HSTRING *value )
......
......@@ -156,16 +156,16 @@ static void test_MediaControlStatics(void)
check_interface( display_updater, &IID_IAgileObject );
hr = ISystemMediaTransportControlsDisplayUpdater_put_Type( display_updater, -1 );
todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControlsDisplayUpdater_put_Type( display_updater, 4 );
todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControlsDisplayUpdater_put_Type( display_updater, 1 );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControlsDisplayUpdater_put_Type( display_updater, MediaPlaybackType_Music );
ok( hr == S_OK, "got hr %#lx.\n", hr );
playback_type = -1;
hr = ISystemMediaTransportControlsDisplayUpdater_get_Type( display_updater, &playback_type );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( playback_type == MediaPlaybackType_Music, "got playback_type %d.\n", playback_type );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( playback_type == MediaPlaybackType_Music, "got playback_type %d.\n", playback_type );
ISystemMediaTransportControlsDisplayUpdater_Release( display_updater );
ISystemMediaTransportControls_Release( media_control_statics );
......
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