From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/Makefile.in | 1 + include/windows.media.playback.idl | 128 +++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 include/windows.media.playback.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 2913b018a9b..cd748b8f00d 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -906,6 +906,7 @@ SOURCES = \ windows.media.faceanalysis.idl \ windows.media.idl \ windows.media.mediaproperties.idl \ + windows.media.playback.idl \ windows.media.render.idl \ windows.media.speechrecognition.idl \ windows.media.speechsynthesis.idl \ diff --git a/include/windows.media.playback.idl b/include/windows.media.playback.idl new file mode 100644 index 00000000000..86db9726d74 --- /dev/null +++ b/include/windows.media.playback.idl @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2025 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.devices.enumeration.idl"; +import "windows.foundation.numerics.idl"; +import "windows.graphics.directx.direct3d11.idl"; +import "windows.media.idl"; +/* import "windows.media.audio.idl"; */ +/* import "windows.media.casting.idl"; */ +import "windows.media.core.idl"; +import "windows.media.mediaproperties.idl"; +/* import "windows.media.protection.idl"; */ +import "windows.storage.idl"; +import "windows.storage.streams.idl"; +import "windows.ui.composition.idl"; + +namespace Windows.Media.Playback { + interface IBackgroundMediaPlayerStatics; + interface IMediaPlayer; + interface IMediaPlayerDataReceivedEventArgs; + + runtimeclass BackgroundMediaPlayer; + runtimeclass MediaPlayer; + runtimeclass MediaPlayerDataReceivedEventArgs; + + declare { + interface Windows.Foundation.EventHandler<Windows.Media.Playback.MediaPlayerDataReceivedEventArgs *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.BackgroundMediaPlayer), + uuid(856ddbc1-55f7-471f-a0f2-68ac4c904592) + ] + interface IBackgroundMediaPlayerStatics : IInspectable + { + [propget] HRESULT Current([out, retval] Windows.Media.Playback.MediaPlayer **player); + [eventadd] HRESULT MessageReceivedFromBackground( + [in] Windows.Foundation.EventHandler<Windows.Media.Playback.MediaPlayerDataReceivedEventArgs *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT MessageReceivedFromBackground([in] EventRegistrationToken token); + [eventadd] HRESULT MessageReceivedFromForeground( + [in] Windows.Foundation.EventHandler<Windows.Media.Playback.MediaPlayerDataReceivedEventArgs *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT MessageReceivedFromForeground([in] EventRegistrationToken token); + HRESULT SendMessageToBackground([in] Windows.Foundation.Collections.ValueSet *value); + HRESULT SendMessageToForeground([in] Windows.Foundation.Collections.ValueSet *value); + HRESULT IsMediaPlaying([out, retval] boolean *value); + HRESULT Shutdown(); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.MediaPlayerDataReceivedEventArgs), + uuid(c75a9405-c801-412a-835b-83fc0e622a8e) + ] + interface IMediaPlayerDataReceivedEventArgs : IInspectable + { + [propget] HRESULT Data([out, retval] Windows.Foundation.Collections.ValueSet **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Media.Playback.IBackgroundMediaPlayerStatics, Windows.Foundation.UniversalApiContract, 1.0), + threading(both) + ] + runtimeclass BackgroundMediaPlayer + { + } + + [ + activatable(Windows.Foundation.UniversalApiContract, 3.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + threading(both) + ] + runtimeclass MediaPlayer + { + [default] interface Windows.Media.Playback.IMediaPlayer; + interface Windows.Media.Playback.IMediaPlayerSource; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Media.Playback.IMediaPlayerSource2; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Media.Playback.IMediaPlayer2; + [contract(Windows.Foundation.UniversalApiContract, 2.0)] interface Windows.Media.Playback.IMediaPlayerEffects; + [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Foundation.IClosable; + [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Media.Playback.IMediaPlayer3; + [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Media.Playback.IMediaPlayer4; + [contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Media.Playback.IMediaPlayerEffects2; + [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Media.Playback.IMediaPlayer5; + [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Media.Playback.IMediaPlayer6; + [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Media.Playback.IMediaPlayer7; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass MediaPlayerDataReceivedEventArgs + { + [default] interface Windows.Media.Playback.IMediaPlayerDataReceivedEventArgs; + } +}