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

windows.media.mediacontrol: Implement some ISystemMediaTransportControls properties.

Called by Roon.
parent 1435688b
......@@ -123,6 +123,12 @@ struct media_control
LONG ref;
HWND window;
MediaPlaybackStatus media_playback_status;
boolean is_play_enabled;
boolean is_pause_enabled;
boolean is_previous_enabled;
boolean is_next_enabled;
boolean is_enabled;
};
static inline struct media_control *impl_from_ISystemMediaTransportControls( ISystemMediaTransportControls *iface )
......@@ -190,14 +196,23 @@ static HRESULT WINAPI media_control_GetTrustLevel( ISystemMediaTransportControls
static HRESULT WINAPI media_control_get_PlaybackStatus( ISystemMediaTransportControls *iface, MediaPlaybackStatus *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->media_playback_status;
return S_OK;
}
static HRESULT WINAPI media_control_put_PlaybackStatus( ISystemMediaTransportControls *iface, MediaPlaybackStatus value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
if (value < MediaPlaybackStatus_Closed || value > MediaPlaybackStatus_Paused) return E_INVALIDARG;
impl->media_playback_status = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_DisplayUpdater( ISystemMediaTransportControls *iface, __x_ABI_CWindows_CMedia_CISystemMediaTransportControlsDisplayUpdater **value )
......@@ -214,26 +229,42 @@ static HRESULT WINAPI media_control_get_SoundLevel( ISystemMediaTransportControl
static HRESULT WINAPI media_control_get_IsEnabled( ISystemMediaTransportControls *iface, boolean *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->is_enabled;
return S_OK;
}
static HRESULT WINAPI media_control_put_IsEnabled( ISystemMediaTransportControls *iface, boolean value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
impl->is_enabled = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_IsPlayEnabled( ISystemMediaTransportControls *iface, boolean *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->is_play_enabled;
return S_OK;
}
static HRESULT WINAPI media_control_put_IsPlayEnabled( ISystemMediaTransportControls *iface, boolean value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
impl->is_play_enabled = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_IsStopEnabled( ISystemMediaTransportControls *iface, boolean *value )
......@@ -250,14 +281,22 @@ static HRESULT WINAPI media_control_put_IsStopEnabled( ISystemMediaTransportCont
static HRESULT WINAPI media_control_get_IsPauseEnabled( ISystemMediaTransportControls *iface, boolean *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->is_pause_enabled;
return S_OK;
}
static HRESULT WINAPI media_control_put_IsPauseEnabled( ISystemMediaTransportControls *iface, boolean value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
impl->is_pause_enabled = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_IsRecordEnabled( ISystemMediaTransportControls *iface, boolean *value )
......@@ -298,26 +337,42 @@ static HRESULT WINAPI media_control_put_IsRewindEnabled( ISystemMediaTransportCo
static HRESULT WINAPI media_control_get_IsPreviousEnabled( ISystemMediaTransportControls *iface, boolean *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->is_previous_enabled;
return S_OK;
}
static HRESULT WINAPI media_control_put_IsPreviousEnabled( ISystemMediaTransportControls *iface, boolean value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
impl->is_previous_enabled = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_IsNextEnabled( ISystemMediaTransportControls *iface, boolean *value )
{
FIXME( "iface %p, value %p stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %p\n", iface, value );
*value = impl->is_next_enabled;
return S_OK;
}
static HRESULT WINAPI media_control_put_IsNextEnabled( ISystemMediaTransportControls *iface, boolean value )
{
FIXME( "iface %p, value %d stub!\n", iface, value );
return E_NOTIMPL;
struct media_control *impl = impl_from_ISystemMediaTransportControls( iface );
TRACE( "iface %p, value %d\n", iface, value );
impl->is_next_enabled = value;
return S_OK;
}
static HRESULT WINAPI media_control_get_IsChannelUpEnabled( ISystemMediaTransportControls *iface, boolean *value )
......
......@@ -104,47 +104,47 @@ static void test_MediaControlStatics(void)
if (!media_control_statics) goto done;
hr = ISystemMediaTransportControls_put_PlaybackStatus( media_control_statics, -1 );
todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_PlaybackStatus( media_control_statics, 5 );
todo_wine ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_PlaybackStatus( media_control_statics, MediaPlaybackStatus_Closed );
todo_wine ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_IsPlayEnabled( media_control_statics, FALSE );
todo_wine ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_IsPauseEnabled( media_control_statics, FALSE );
todo_wine ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_IsPreviousEnabled( media_control_statics, FALSE );
todo_wine ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_IsNextEnabled( media_control_statics, FALSE );
todo_wine ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
ok( hr == S_OK || broken(hr == S_FALSE) /* Win10 1507,1607 */, "got hr %#lx.\n", hr );
hr = ISystemMediaTransportControls_put_IsEnabled( media_control_statics, FALSE );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( hr == S_OK, "got hr %#lx.\n", hr );
value = TRUE;
hr = ISystemMediaTransportControls_get_IsPlayEnabled( media_control_statics, &value );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( value == FALSE, "got value %d.\n", value );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( value == FALSE, "got value %d.\n", value );
value = TRUE;
hr = ISystemMediaTransportControls_get_IsPauseEnabled( media_control_statics, &value );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( value == FALSE, "got value %d.\n", value );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( value == FALSE, "got value %d.\n", value );
value = TRUE;
hr = ISystemMediaTransportControls_get_IsPreviousEnabled( media_control_statics, &value );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( value == FALSE, "got value %d.\n", value );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( value == FALSE, "got value %d.\n", value );
value = TRUE;
hr = ISystemMediaTransportControls_get_IsNextEnabled( media_control_statics, &value );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( value == FALSE, "got value %d.\n", value );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( value == FALSE, "got value %d.\n", value );
value = TRUE;
hr = ISystemMediaTransportControls_get_IsEnabled( media_control_statics, &value );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( value == FALSE, "got value %d.\n", value );
ok( hr == S_OK, "got hr %#lx.\n", hr );
ok( value == FALSE, "got value %d.\n", value );
ref = ISystemMediaTransportControls_Release( media_control_statics );
ok( ref == 1 || broken(ref == 3) /* Win10 1507 */ || broken(ref == 2) /* Win10 1607 */, "got ref %ld.\n", ref );
......
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