From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- include/windows.media.playback.idl | 274 +++++++++++++++++++++++++++++ 1 file changed, 274 insertions(+)
diff --git a/include/windows.media.playback.idl b/include/windows.media.playback.idl index efdebbb983b..81509b262e1 100644 --- a/include/windows.media.playback.idl +++ b/include/windows.media.playback.idl @@ -41,18 +41,66 @@ import "windows.ui.composition.idl"; #endif
namespace Windows.Media.Playback { + typedef enum MediaPlayerError MediaPlayerError; + typedef enum MediaPlayerState MediaPlayerState; + interface IBackgroundMediaPlayerStatics; interface IMediaPlayer; interface IMediaPlayerDataReceivedEventArgs; + interface IMediaPlayerFailedEventArgs; + interface IMediaPlayerRateChangedEventArgs; + interface IPlaybackMediaMarker; + interface IPlaybackMediaMarkerFactory; + interface IPlaybackMediaMarkerReachedEventArgs; + interface IPlaybackMediaMarkerSequence;
runtimeclass BackgroundMediaPlayer; runtimeclass MediaPlayer; runtimeclass MediaPlayerDataReceivedEventArgs; + runtimeclass MediaPlayerFailedEventArgs; + runtimeclass MediaPlayerRateChangedEventArgs; + runtimeclass PlaybackMediaMarker; + runtimeclass PlaybackMediaMarkerSequence; + runtimeclass PlaybackMediaMarkerReachedEventArgs;
declare { interface Windows.Foundation.EventHandler<Windows.Media.Playback.MediaPlayerDataReceivedEventArgs *>; +#ifndef _WINDOWS_MEDIA_PLAYBACK_BACKGROUNDMEDIAPLAYER + interface Windows.Foundation.Collections.IIterable<Windows.Media.Playback.PlaybackMediaMarker *>; + interface Windows.Foundation.Collections.IIterator<Windows.Media.Playback.PlaybackMediaMarker *>; + interface Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.MediaPlayerFailedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.MediaPlayerRateChangedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.PlaybackMediaMarkerReachedEventArgs *>; +#endif }
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum MediaPlayerError + { + Unknown = 0, + Aborted = 1, + NetworkError = 2, + DecodingError = 3, + SourceNotSupported = 4, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + /* deprecated("Use MediaPlaybackState instead of MediaPlayerState. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0) */ + ] + enum MediaPlayerState + { + Closed = 0, + Opening = 1, + Buffering = 2, + Playing = 3, + Paused = 4, + Stopped = 5, + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Media.Playback.BackgroundMediaPlayer), @@ -77,6 +125,113 @@ namespace Windows.Media.Playback { HRESULT Shutdown(); }
+#ifndef _WINDOWS_MEDIA_PLAYBACK_BACKGROUNDMEDIAPLAYER + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.MediaPlayer), + uuid(381a83cb-6fff-499b-8d64-2885dfc1249e) + ] + interface IMediaPlayer : IInspectable + { + [propget] HRESULT AutoPlay([out, retval] boolean *value); + [propput] HRESULT AutoPlay([in] boolean value); + [deprecated("Use PlaybackSession.NaturalDuration instead of NaturalDuration. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT NaturalDuration([out, retval] Windows.Foundation.TimeSpan *value); + [deprecated("Use PlaybackSession.Position instead of Position. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT Position([out, retval] Windows.Foundation.TimeSpan *value); + [deprecated("Use PlaybackSession.Position instead of Position. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propput] HRESULT Position([in] Windows.Foundation.TimeSpan value); + [deprecated("Use PlaybackSession.BufferingProgress instead of BufferingProgress. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT BufferingProgress([out, retval] DOUBLE *value); + [deprecated("Use PlaybackSession.State instead of CurrentState. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT CurrentState([out, retval] Windows.Media.Playback.MediaPlayerState *value); + [deprecated("Use PlaybackSession.CanSeek instead of CanSeek. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT CanSeek([out, retval] boolean *value); + [deprecated("Use PlaybackSession.CanPause instead of CanPause. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT CanPause([out, retval] boolean *value); + [propget] HRESULT IsLoopingEnabled([out, retval] boolean *value); + [propput] HRESULT IsLoopingEnabled([in] boolean value); + [deprecated("Use PlaybackSession.IsProtected instead of IsProtected. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT IsProtected([out, retval] boolean *value); + [propget] HRESULT IsMuted([out, retval] boolean *value); + [propput] HRESULT IsMuted([in] boolean value); + [deprecated("Use PlaybackSession.PlaybackRate instead of PlaybackRate. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propget] HRESULT PlaybackRate([out, retval] DOUBLE *value); + [deprecated("Use PlaybackSession.PlaybackRate instead of PlaybackRate. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [propput] HRESULT PlaybackRate([in] DOUBLE value); + [propget] HRESULT Volume([out, retval] DOUBLE *value); + [propput] HRESULT Volume([in] DOUBLE value); + [deprecated("Use media tracks on MediaPlaybackItem instead of PlaybackMediaMarkers. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 2.0)] + [propget] HRESULT PlaybackMediaMarkers([out, retval] Windows.Media.Playback.PlaybackMediaMarkerSequence **value); + [eventadd] HRESULT MediaOpened( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT MediaOpened([in] EventRegistrationToken token); + [eventadd] HRESULT MediaEnded( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT MediaEnded([in] EventRegistrationToken token); + [eventadd] HRESULT MediaFailed( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.MediaPlayerFailedEventArgs *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT MediaFailed([in] EventRegistrationToken token); + [deprecated("Use PlaybackSession.PlaybackStateChanged instead of CurrentStateChanged. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventadd] HRESULT CurrentStateChanged( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use PlaybackSession.PlaybackStateChanged instead of CurrentStateChanged. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventremove] HRESULT CurrentStateChanged([in] EventRegistrationToken token); + [deprecated("Use media tracks on MediaPlaybackItem instead of PlaybackMediaMarkers. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 2.0)] + [eventadd] HRESULT PlaybackMediaMarkerReached( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.PlaybackMediaMarkerReachedEventArgs *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use media tracks on MediaPlaybackItem instead of PlaybackMediaMarkers. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 2.0)] + [eventremove] HRESULT PlaybackMediaMarkerReached([in] EventRegistrationToken token); + [deprecated("Use PlaybackSession.PlaybackRateChanged instead of MediaPlayerRateChanged. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventadd] HRESULT MediaPlayerRateChanged( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, Windows.Media.Playback.MediaPlayerRateChangedEventArgs *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use PlaybackSession.PlaybackRateChanged instead of MediaPlayerRateChanged. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventremove] HRESULT MediaPlayerRateChanged([in] EventRegistrationToken token); + [eventadd] HRESULT VolumeChanged( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [eventremove] HRESULT VolumeChanged([in] EventRegistrationToken token); + [deprecated("Use PlaybackSession.SeekCompleted instead of SeekCompleted. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventadd] HRESULT SeekCompleted( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use PlaybackSession.SeekCompleted instead of SeekCompleted. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventremove] HRESULT SeekCompleted([in] EventRegistrationToken token); + [deprecated("Use PlaybackSession.BufferingStarted instead of BufferingStarted. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventadd] HRESULT BufferingStarted( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use PlaybackSession.BufferingStarted instead of BufferingStarted. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventremove] HRESULT BufferingStarted([in] EventRegistrationToken token); + [deprecated("Use PlaybackSession.BufferingEnded instead of BufferingEnded. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventadd] HRESULT BufferingEnded( + [in] Windows.Foundation.TypedEventHandler<Windows.Media.Playback.MediaPlayer *, IInspectable *> *value, + [out, retval] EventRegistrationToken *token + ); + [deprecated("Use PlaybackSession.BufferingEnded instead of BufferingEnded. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 3.0)] + [eventremove] HRESULT BufferingEnded([in] EventRegistrationToken token); + HRESULT Play(); + HRESULT Pause(); + [deprecated("Use Source instead of SetUriSource. For more info, see MSDN.", deprecate, Windows.Foundation.UniversalApiContract, 2.0)] + HRESULT SetUriSource([in] Windows.Foundation.Uri *value); + } +#endif + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.Media.Playback.MediaPlayerDataReceivedEventArgs), @@ -87,6 +242,76 @@ namespace Windows.Media.Playback { [propget] HRESULT Data([out, retval] Windows.Foundation.Collections.ValueSet **value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.MediaPlayerFailedEventArgs), + uuid(2744e9b9-a7e3-4f16-bac4-7914ebc08301) + ] + interface IMediaPlayerFailedEventArgs : IInspectable + { + [propget] HRESULT Error([out, retval] Windows.Media.Playback.MediaPlayerError *value); + [propget] HRESULT ExtendedErrorCode([out, retval] HRESULT *value); + [propget] HRESULT ErrorMessage([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.MediaPlayerRateChangedEventArgs), + uuid(40600d58-3b61-4bb2-989f-fc65608b6cab) + ] + interface IMediaPlayerRateChangedEventArgs : IInspectable + { + [propget] HRESULT NewRate([out, retval] DOUBLE *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.PlaybackMediaMarker), + uuid(c4d22f5c-3c1c-4444-b6b9-778b0422d41a) + ] + interface IPlaybackMediaMarker : IInspectable + { + [propget] HRESULT Time([out, retval] Windows.Foundation.TimeSpan *value); + [propget] HRESULT MediaMarkerType([out, retval] HSTRING *value); + [propget] HRESULT Text([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.PlaybackMediaMarker), + uuid(8c530a78-e0ae-4e1a-a8c8-e23f982a937b) + ] + interface IPlaybackMediaMarkerFactory : IInspectable + { + HRESULT CreateFromTime([in] Windows.Foundation.TimeSpan value, [out, retval] Windows.Media.Playback.PlaybackMediaMarker **marker); + HRESULT Create([in] Windows.Foundation.TimeSpan value, [in] HSTRING media_market_type, [in] HSTRING text, [out, retval] Windows.Media.Playback.PlaybackMediaMarker **marker); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.PlaybackMediaMarkerReachedEventArgs), + uuid(578cd1b9-90e2-4e60-abc4-8740b01f6196) + ] + interface IPlaybackMediaMarkerReachedEventArgs : IInspectable + { + [propget] HRESULT PlaybackMediaMarker([out, retval] Windows.Media.Playback.PlaybackMediaMarker **value); + } + +#ifndef _WINDOWS_MEDIA_PLAYBACK_BACKGROUNDMEDIAPLAYER + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Media.Playback.PlaybackMediaMarkerSequence), + uuid(f2810cee-638b-46cf-8817-1d111fe9d8c4) + ] + interface IPlaybackMediaMarkerSequence : IInspectable + requires Windows.Foundation.Collections.IIterable<Windows.Media.Playback.PlaybackMediaMarker *> + { + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT Insert([in] Windows.Media.Playback.PlaybackMediaMarker *value); + HRESULT Clear(); + } +#endif + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -129,4 +354,53 @@ namespace Windows.Media.Playback { { [default] interface Windows.Media.Playback.IMediaPlayerDataReceivedEventArgs; } + +#ifndef _WINDOWS_MEDIA_PLAYBACK_BACKGROUNDMEDIAPLAYER + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass MediaPlayerFailedEventArgs + { + [default] interface Windows.Media.Playback.IMediaPlayerFailedEventArgs; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass MediaPlayerRateChangedEventArgs + { + [default] interface Windows.Media.Playback.IMediaPlayerRateChangedEventArgs; + } + + [ + activatable(Windows.Media.Playback.IPlaybackMediaMarkerFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass PlaybackMediaMarker + { + [default] interface Windows.Media.Playback.IPlaybackMediaMarker; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass PlaybackMediaMarkerSequence + { + [default] interface Windows.Media.Playback.IPlaybackMediaMarkerSequence; + interface Windows.Foundation.Collections.IIterable<Windows.Media.Playback.PlaybackMediaMarker*>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass PlaybackMediaMarkerReachedEventArgs + { + [default] interface Windows.Media.Playback.IPlaybackMediaMarkerReachedEventArgs; + } +#endif }