Module: wine Branch: master Commit: 5861f8c55d73bdad0dc6830af80c693a7cbc925d URL: https://gitlab.winehq.org/wine/wine/-/commit/5861f8c55d73bdad0dc6830af80c693...
Author: Mohamad Al-Jaf mohamadaljaf@gmail.com Date: Thu Sep 28 19:29:24 2023 -0400
windows.media.mediacontrol: Implement IMusicDisplayProperties2::get/put_AlbumTitle().
Called by Roon.
---
dlls/windows.media.mediacontrol/main.c | 12 ++++++++---- dlls/windows.media.mediacontrol/tests/mediacontrol.c | 10 +++++----- 2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/dlls/windows.media.mediacontrol/main.c b/dlls/windows.media.mediacontrol/main.c index a8a2a42811c..7fa74f663f3 100644 --- a/dlls/windows.media.mediacontrol/main.c +++ b/dlls/windows.media.mediacontrol/main.c @@ -123,6 +123,7 @@ struct music_properties IMusicDisplayProperties2 IMusicDisplayProperties2_iface; LONG ref;
+ HSTRING album_title; HSTRING artist; HSTRING title; }; @@ -266,14 +267,17 @@ DEFINE_IINSPECTABLE( music_properties2, IMusicDisplayProperties2, struct music_p
static HRESULT STDMETHODCALLTYPE music_properties2_get_AlbumTitle( IMusicDisplayProperties2 *iface, HSTRING *value ) { - FIXME( "iface %p, value %p stub\n", iface, value ); - return E_NOTIMPL; + struct music_properties *impl = impl_from_IMusicDisplayProperties2( iface ); + TRACE( "iface %p, value %p\n", iface, value ); + return WindowsDuplicateString( impl->album_title, value ); }
static HRESULT STDMETHODCALLTYPE music_properties2_put_AlbumTitle( IMusicDisplayProperties2 *iface, HSTRING value ) { - FIXME( "iface %p, value %s stub\n", iface, debugstr_hstring( value ) ); - return E_NOTIMPL; + struct music_properties *impl = impl_from_IMusicDisplayProperties2( iface ); + TRACE( "iface %p, value %p\n", iface, value ); + WindowsDeleteString( impl->album_title ); + return WindowsDuplicateString( value, &impl->album_title ); }
static HRESULT STDMETHODCALLTYPE music_properties2_get_TrackNumber( IMusicDisplayProperties2 *iface, UINT32 *value ) diff --git a/dlls/windows.media.mediacontrol/tests/mediacontrol.c b/dlls/windows.media.mediacontrol/tests/mediacontrol.c index c87372aaa02..194b541e6f7 100644 --- a/dlls/windows.media.mediacontrol/tests/mediacontrol.c +++ b/dlls/windows.media.mediacontrol/tests/mediacontrol.c @@ -212,17 +212,17 @@ static void test_MediaControlStatics(void) ok( hr == S_OK, "got hr %#lx.\n", hr );
hr = IMusicDisplayProperties2_put_AlbumTitle( music_properties2, NULL ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = WindowsCreateStringReference( L"Wine Hits", wcslen( L"Wine Hits" ), &header, &str ); ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IMusicDisplayProperties2_put_AlbumTitle( music_properties2, str ); - todo_wine ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); hr = IMusicDisplayProperties2_get_AlbumTitle( music_properties2, &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 ); ok( hr == S_OK, "got hr %#lx.\n", hr ); - todo_wine 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( !res, "got string %s.\n", debugstr_hstring( ret_str ) ); + ok( str != ret_str, "got same HSTRINGs %p, %p.\n", str, ret_str ); WindowsDeleteString( str ); WindowsDeleteString( ret_str );