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

windows.media.mediacontrol: Implement IMusicDisplayProperties::get/put_Artist().

Called by Roon.
parent b7768065
...@@ -122,6 +122,7 @@ struct music_properties ...@@ -122,6 +122,7 @@ struct music_properties
IMusicDisplayProperties IMusicDisplayProperties_iface; IMusicDisplayProperties IMusicDisplayProperties_iface;
LONG ref; LONG ref;
HSTRING artist;
HSTRING title; HSTRING title;
}; };
...@@ -168,6 +169,7 @@ static ULONG WINAPI music_properties_Release( IMusicDisplayProperties *iface ) ...@@ -168,6 +169,7 @@ static ULONG WINAPI music_properties_Release( IMusicDisplayProperties *iface )
if (!ref) if (!ref)
{ {
WindowsDeleteString( impl->artist );
WindowsDeleteString( impl->title ); WindowsDeleteString( impl->title );
free( impl ); free( impl );
} }
...@@ -221,14 +223,17 @@ static HRESULT WINAPI music_properties_put_AlbumArtist( IMusicDisplayProperties ...@@ -221,14 +223,17 @@ static HRESULT WINAPI music_properties_put_AlbumArtist( IMusicDisplayProperties
static HRESULT WINAPI music_properties_get_Artist( IMusicDisplayProperties *iface, HSTRING *value ) static HRESULT WINAPI music_properties_get_Artist( IMusicDisplayProperties *iface, HSTRING *value )
{ {
FIXME( "iface %p, value %p stub!\n", iface, value ); struct music_properties *impl = impl_from_IMusicDisplayProperties( iface );
return E_NOTIMPL; TRACE( "iface %p, value %p\n", iface, value );
return WindowsDuplicateString( impl->artist, value );
} }
static HRESULT WINAPI music_properties_put_Artist( IMusicDisplayProperties *iface, HSTRING value ) static HRESULT WINAPI music_properties_put_Artist( IMusicDisplayProperties *iface, HSTRING value )
{ {
FIXME( "iface %p, value %s stub!\n", iface, debugstr_hstring(value) ); struct music_properties *impl = impl_from_IMusicDisplayProperties( iface );
return E_NOTIMPL; TRACE( "iface %p, value %p\n", iface, value );
WindowsDeleteString( impl->artist );
return WindowsDuplicateString( value, &impl->artist );
} }
static const IMusicDisplayPropertiesVtbl music_properties_vtbl = static const IMusicDisplayPropertiesVtbl music_properties_vtbl =
......
...@@ -193,17 +193,17 @@ static void test_MediaControlStatics(void) ...@@ -193,17 +193,17 @@ static void test_MediaControlStatics(void)
WindowsDeleteString( ret_str ); WindowsDeleteString( ret_str );
hr = IMusicDisplayProperties_put_Artist( music_properties, NULL ); hr = IMusicDisplayProperties_put_Artist( music_properties, NULL );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = WindowsCreateStringReference( L"The Wine Project", wcslen( L"The Wine Project" ), &header, &str ); hr = WindowsCreateStringReference( L"The Wine Project", wcslen( L"The Wine Project" ), &header, &str );
ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IMusicDisplayProperties_put_Artist( music_properties, str ); hr = IMusicDisplayProperties_put_Artist( music_properties, str );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IMusicDisplayProperties_get_Artist( music_properties, &ret_str ); hr = IMusicDisplayProperties_get_Artist( music_properties, &ret_str );
todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = WindowsCompareStringOrdinal( str, ret_str, &res ); hr = WindowsCompareStringOrdinal( str, ret_str, &res );
ok( hr == S_OK, "got hr %#lx.\n", hr ); ok( hr == S_OK, "got hr %#lx.\n", hr );
todo_wine ok( !res, "got string %s.\n", debugstr_hstring( ret_str ) ); ok( !res, "got string %s.\n", debugstr_hstring( ret_str ) );
todo_wine ok( str != ret_str, "got same HSTRINGs %p, %p.\n", str, ret_str ); ok( str != ret_str, "got same HSTRINGs %p, %p.\n", str, ret_str );
WindowsDeleteString( str ); WindowsDeleteString( str );
WindowsDeleteString( ret_str ); WindowsDeleteString( ret_str );
......
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