Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
84418169
Commit
84418169
authored
Sep 28, 2023
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
Oct 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.media.mediacontrol: Implement some ISystemMediaTransportControls properties.
Called by Roon.
parent
1435688b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
42 deletions
+97
-42
main.c
dlls/windows.media.mediacontrol/main.c
+79
-24
mediacontrol.c
dlls/windows.media.mediacontrol/tests/mediacontrol.c
+18
-18
No files found.
dlls/windows.media.mediacontrol/main.c
View file @
84418169
...
...
@@ -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
)
...
...
dlls/windows.media.mediacontrol/tests/mediacontrol.c
View file @
84418169
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment