diff --git a/src/Constants.mac.cs.in b/src/Constants.mac.cs.in index 8d771cda48ec..8fec4e481d2d 100644 --- a/src/Constants.mac.cs.in +++ b/src/Constants.mac.cs.in @@ -123,5 +123,6 @@ namespace MonoMac { // macOS 10.12 public const string PhotosLibrary = "/System/Library/Frameworks/Photos.framework/Photos"; public const string IntentsLibrary = "/System/Library/Frameworks/Intents.framework/Intents"; + public const string MediaPlayerLibrary = "/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer"; } } diff --git a/src/MediaPlayer/MPMediaItem.cs b/src/MediaPlayer/MPMediaItem.cs index 880c8bee0495..15f4234ef2b6 100644 --- a/src/MediaPlayer/MPMediaItem.cs +++ b/src/MediaPlayer/MPMediaItem.cs @@ -9,7 +9,7 @@ // Copyright 2011-2012 Xamarin, Inc // -#if !TVOS +#if !TVOS && !MONOMAC using System; using System.Collections; diff --git a/src/MediaPlayer/MPMediaQuery.cs b/src/MediaPlayer/MPMediaQuery.cs index 34776cbda053..65293652116a 100644 --- a/src/MediaPlayer/MPMediaQuery.cs +++ b/src/MediaPlayer/MPMediaQuery.cs @@ -9,7 +9,7 @@ // Copyright 2011-2012, 2014-2015 Xamarin, Inc // -#if !TVOS +#if !TVOS && !MONOMAC using System; using XamCore.Foundation; diff --git a/src/MediaPlayer/MPNowPlayingInfoCenter.cs b/src/MediaPlayer/MPNowPlayingInfoCenter.cs index f60b35672e7e..9e0a96dbcd02 100644 --- a/src/MediaPlayer/MPNowPlayingInfoCenter.cs +++ b/src/MediaPlayer/MPNowPlayingInfoCenter.cs @@ -7,7 +7,7 @@ // Copyright 2011, Xamarin Inc // -#if !TVOS +#if !TVOS && !MONOMAC using XamCore.Foundation; using XamCore.ObjCRuntime; diff --git a/src/MediaPlayer/MPPlayableContentDelegate.cs b/src/MediaPlayer/MPPlayableContentDelegate.cs index 4741d215d64d..6866a73ebfd1 100644 --- a/src/MediaPlayer/MPPlayableContentDelegate.cs +++ b/src/MediaPlayer/MPPlayableContentDelegate.cs @@ -1,4 +1,4 @@ -#if !XAMCORE_3_0 +#if !XAMCORE_3_0 && !MONOMAC using System; using XamCore.Foundation; diff --git a/src/MediaPlayer/MPVolumeSettings.cs b/src/MediaPlayer/MPVolumeSettings.cs index 8e75410811ef..211d5879008e 100644 --- a/src/MediaPlayer/MPVolumeSettings.cs +++ b/src/MediaPlayer/MPVolumeSettings.cs @@ -6,7 +6,7 @@ // Copyright 2011-2015 Xamarin, Inc. // -#if !TVOS +#if !TVOS && !MONOMAC using System; using System.Runtime.InteropServices; diff --git a/src/MediaPlayer/MediaPlayer.cs b/src/MediaPlayer/MediaPlayer.cs index d4496a9a3bb6..9d0cd0fd91bd 100644 --- a/src/MediaPlayer/MediaPlayer.cs +++ b/src/MediaPlayer/MediaPlayer.cs @@ -16,6 +16,7 @@ namespace XamCore.MediaPlayer { // NSInteger -> MPMoviePlayerController.h [Native] + [NoMac] [NoTV] public enum MPMoviePlaybackState : nint { Stopped, @@ -28,6 +29,7 @@ public enum MPMoviePlaybackState : nint { // NSInteger -> MPMoviePlayerController.h [Native] + [NoMac] [NoTV] public enum MPMovieLoadState : nint { Unknown = 0, @@ -37,6 +39,7 @@ public enum MPMovieLoadState : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -46,6 +49,7 @@ public enum MPMovieRepeatMode : nint { // NSInteger -> MPMoviePlayerController.h [Native] + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] public enum MPMovieControlStyle : nint { @@ -53,6 +57,7 @@ public enum MPMovieControlStyle : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -61,6 +66,7 @@ public enum MPMovieFinishReason : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -72,6 +78,7 @@ public enum MPMovieMediaType : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -80,6 +87,7 @@ public enum MPMovieSourceType : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -89,6 +97,7 @@ public enum MPMovieTimeOption : nint { } // NSUInteger -> MPMediaItem.h + [NoMac] [Native] [Flags] [NoTV] @@ -131,6 +140,7 @@ public enum MPMediaType : nuint_compat_int { } // NSInteger -> MPMediaPlaylist.h + [NoMac] [Native] [Flags] [NoTV] @@ -143,6 +153,7 @@ public enum MPMediaPlaylistAttribute : nint { // NSInteger -> MPMediaQuery.h [Native] + [NoMac] [NoTV] public enum MPMediaGrouping : nint { Title, @@ -157,6 +168,7 @@ public enum MPMediaGrouping : nint { // NSInteger -> MPMediaQuery.h [Native] + [NoMac] [NoTV] public enum MPMediaPredicateComparison : nint { EqualsTo, @@ -164,6 +176,7 @@ public enum MPMediaPredicateComparison : nint { } // NSInteger -> MPMoviePlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -175,6 +188,7 @@ public enum MPMovieScalingMode : nint { } // untyped enum -> MPMoviePlayerController.h + [NoMac] public enum MPMovieControlMode { Default, VolumeOnly, @@ -182,6 +196,7 @@ public enum MPMovieControlMode { } // NSInteger -> /MPMusicPlayerController.h + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [Native] @@ -196,6 +211,7 @@ public enum MPMusicPlaybackState : nint { // NSInteger -> /MPMusicPlayerController.h [Native] + [NoMac] [NoTV] public enum MPMusicRepeatMode : nint { Default, @@ -206,6 +222,7 @@ public enum MPMusicRepeatMode : nint { // NSInteger -> /MPMusicPlayerController.h [Native] + [NoMac] [NoTV] public enum MPMusicShuffleMode : nint { Default, @@ -216,6 +233,7 @@ public enum MPMusicShuffleMode : nint { public delegate void MPMediaItemEnumerator (string property, NSObject value, ref bool stop); + [Mac (10,12,2)] [Native] public enum MPShuffleType : nint { @@ -224,6 +242,7 @@ public enum MPShuffleType : nint Collections } + [Mac (10,12,2)] [Native] public enum MPRepeatType : nint { @@ -232,6 +251,7 @@ public enum MPRepeatType : nint All } + [Mac (10,12,2)] [iOS (10,0)] [Native] public enum MPChangeLanguageOptionSetting : nint @@ -243,6 +263,7 @@ public enum MPChangeLanguageOptionSetting : nint // NSInteger -> MPRemoteCommand.h [Native] + [Mac (10,12,2)] [iOS (7,1)] public enum MPRemoteCommandHandlerStatus : nint { Success = 0, @@ -254,12 +275,14 @@ public enum MPRemoteCommandHandlerStatus : nint { // NSUInteger -> MPRemoteCommandEvent.h [Native] + [Mac (10,12,2)] [iOS (7,1)] public enum MPSeekCommandEventType : nuint_compat_int { BeginSeeking, EndSeeking } + [Mac (10,12,2)] [iOS (9,0)] [Native] public enum MPNowPlayingInfoLanguageOptionType : nuint { @@ -267,6 +290,7 @@ public enum MPNowPlayingInfoLanguageOptionType : nuint { Legible } + [NoMac] [iOS (9,3)] [Native] [ErrorDomain ("MPErrorDomain")] @@ -281,6 +305,7 @@ public enum MPErrorCode : nint { Cancelled, } + [NoMac] [NoTV] [iOS (9,3)] [Native] @@ -291,6 +316,7 @@ public enum MPMediaLibraryAuthorizationStatus : nint { Authorized } + [Mac (10,12,2)] [iOS (10,0)] [Native] public enum MPNowPlayingInfoMediaType : nuint @@ -300,4 +326,17 @@ public enum MPNowPlayingInfoMediaType : nuint Video } + [Mac (10,12,2)] + [NoiOS] + [NoTV] + [Native] + public enum MPNowPlayingPlaybackState : nuint + { + Unknown = 0, + Playing, + Paused, + Stopped, + Interrupted, + } + } diff --git a/src/frameworks.sources b/src/frameworks.sources index cca4180426a3..ff8d1be10c75 100644 --- a/src/frameworks.sources +++ b/src/frameworks.sources @@ -1537,6 +1537,7 @@ MAC_FRAMEWORKS = \ MapKit \ MediaAccessibility \ MediaLibrary \ + MediaPlayer \ MediaToolbox \ Metal \ MetalKit \ diff --git a/src/mediaplayer.cs b/src/mediaplayer.cs index 96660060f74e..306229b93812 100644 --- a/src/mediaplayer.cs +++ b/src/mediaplayer.cs @@ -13,11 +13,16 @@ using XamCore.CoreFoundation; using XamCore.CoreGraphics; using XamCore.CoreLocation; +#if MONOMAC +using XamCore.AppKit; +#else using XamCore.UIKit; +#endif using System; namespace XamCore.MediaPlayer { + [NoMac] [NoTV] [BaseType (typeof (NSObject))] #if XAMCORE_2_0 @@ -47,6 +52,7 @@ interface MPMediaItem : NSSecureCoding { #if XAMCORE_2_0 } + [NoMac] [NoTV] [BaseType (typeof (MPMediaEntity))] interface MPMediaItem { @@ -245,9 +251,11 @@ interface MPMediaItem { NSString DateAddedProperty { get; } } + [Mac (10,12,2)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] interface MPMediaItemArtwork { +#if !MONOMAC [iOS (10,0)] [TV (10,0)] [Export ("initWithBoundsSize:requestHandler:")] @@ -261,15 +269,26 @@ interface MPMediaItemArtwork { [Export ("imageWithSize:")] [return: NullAllowed] UIImage ImageWithSize (CGSize size); +#else + [Export ("initWithBoundsSize:requestHandler:")] + [DesignatedInitializer] + IntPtr Constructor (CGSize boundsSize, Func requestHandler); + + [Export ("imageWithSize:")] + [return: NullAllowed] + NSImage ImageWithSize (CGSize size); +#endif [Export ("bounds")] CGRect Bounds { get; } + [NoMac] [Deprecated (PlatformName.iOS, 10, 0)] [Export ("imageCropRect")] CGRect ImageCropRectangle { get; } } + [NoMac] [NoTV] // Objective-C exception thrown. Name: MPMediaItemCollectionInitException Reason: -init is not supported, use -initWithItems: [DisableDefaultCtor] @@ -306,6 +325,7 @@ interface MPMediaItemCollection : MPMediaEntity, NSSecureCoding { MPMediaType MediaTypes { get; } } + [NoMac] [NoTV] [BaseType (typeof (NSObject))] interface MPMediaLibrary : NSSecureCoding { @@ -352,6 +372,7 @@ interface MPMediaLibrary : NSSecureCoding { void GetPlaylist (NSUuid uuid, [NullAllowed] MPMediaPlaylistCreationMetadata creationMetadata, Action completionHandler); } +#if !MONOMAC [NoTV] [BaseType (typeof (UIViewController), Delegates=new string [] { "WeakDelegate" }, Events=new Type [] {typeof(MPMediaPickerControllerDelegate)})] interface MPMediaPickerController { @@ -396,7 +417,9 @@ interface MPMediaPickerControllerDelegate { [Export ("mediaPickerDidCancel:"), EventArgs ("MPMediaPickerController"), EventName ("DidCancel")] void MediaPickerDidCancel (MPMediaPickerController sender); } +#endif + [NoMac] [NoTV] [BaseType (typeof (MPMediaItemCollection))] // Objective-C exception thrown. Name: MPMediaItemCollectionInitException Reason: -init is not supported, use -initWithItems: @@ -438,6 +461,7 @@ interface MPMediaPlaylist : NSSecureCoding { void AddMediaItems (MPMediaItem[] mediaItems, [NullAllowed] Action completionHandler); } + [NoMac] [Static] interface MPMediaPlaylistProperty { [Field ("MPMediaPlaylistPropertyPersistentID")] @@ -463,6 +487,7 @@ interface MPMediaPlaylistProperty { NSString AuthorDisplayName { get; } } + [NoMac] [NoTV] [BaseType (typeof (NSObject))] interface MPMediaQuery : NSSecureCoding, NSCopying { @@ -552,11 +577,13 @@ interface MPMediaQuery : NSSecureCoding, NSCopying { MPMediaQuerySection [] ItemSections { get; } } + [NoMac] [NoTV] [BaseType (typeof (NSObject))] interface MPMediaPredicate : NSSecureCoding { } + [NoMac] [NoTV] [BaseType (typeof (MPMediaPredicate))] interface MPMediaPropertyPredicate { @@ -576,6 +603,7 @@ interface MPMediaPropertyPredicate { MPMediaPredicateComparison ComparisonType { get; } } + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -590,6 +618,7 @@ interface MPMovieAccessLog : NSCopying { NSData ExtendedLogData { get; } } + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -604,6 +633,7 @@ interface MPMovieErrorLog : NSCopying { NSData ExtendedLogData { get; } } + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -651,6 +681,7 @@ interface MPMovieAccessLogEvent : NSCopying { nint DroppedVideoFrameCount { get; } } + [NoMac] [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -677,12 +708,14 @@ interface MPMovieErrorLogEvent : NSCopying { string ErrorComment { get; } } + [NoMac] [Availability (Deprecated = Platform.iOS_9_0)] interface MPMoviePlayerFinishedEventArgs { [Export ("MPMoviePlayerPlaybackDidFinishReasonUserInfoKey")] MPMovieFinishReason FinishReason { get; } } +#if !MONOMAC [Availability (Deprecated = Platform.iOS_9_0)] interface MPMoviePlayerFullScreenEventArgs { [Export ("MPMoviePlayerFullscreenAnimationDurationUserInfoKey")] @@ -703,7 +736,9 @@ interface MPMoviePlayerThumbnailEventArgs { [Export ("MPMoviePlayerThumbnailErrorKey")] NSError Error { get; } } +#endif + [NoMac] [Availability (Deprecated = Platform.iOS_9_0)] interface MPMoviePlayerTimedMetadataEventArgs { [Export ("MPMoviePlayerTimedMetadataUserInfoKey")] @@ -711,6 +746,7 @@ interface MPMoviePlayerTimedMetadataEventArgs { } // no [Model] yet... it can be easily created in user code (all abstract) if needed + [NoMac] [Protocol] interface MPMediaPlayback { [Abstract] @@ -762,6 +798,7 @@ interface MPMediaPlayback { void EndSeeking (); } +#if !MONOMAC [NoTV] [Availability (Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -1032,7 +1069,9 @@ interface MPMoviePlayerController : MPMediaPlayback { [Notification] NSString MPMoviePlayerIsAirPlayVideoActiveDidChangeNotification { get; } } +#endif + [NoMac] [NoTV] [Availability (Introduced = Platform.iOS_4_0, Deprecated = Platform.iOS_9_0)] [BaseType (typeof (NSObject))] @@ -1059,6 +1098,7 @@ interface MPTimedMetadata { NSDictionary AllMetadata { get; } } +#if !MONOMAC [NoTV] [BaseType (typeof (UIViewController))] [Availability (Introduced = Platform.iOS_3_2, Deprecated = Platform.iOS_9_0)] @@ -1075,7 +1115,9 @@ interface MPMoviePlayerViewController { [Export ("shouldAutorotateToInterfaceOrientation:")] bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation orientation); } +#endif + [NoMac] [NoTV] [BaseType (typeof (NSObject))] interface MPMusicPlayerController : MPMediaPlayback { @@ -1120,10 +1162,12 @@ interface MPMusicPlayerController : MPMediaPlayback { [Export ("setQueueWithStoreIDs:")] void SetQueue (string[] storeIDs); + [TV (10,1)] [iOS (10,1)] [Export ("setQueueWithDescriptor:")] void SetQueue (MPMusicPlayerQueueDescriptor descriptor); + [TV (10,1)] [iOS (10,1)] [Async] [Export ("prepareToPlayWithCompletionHandler:")] @@ -1157,6 +1201,7 @@ interface MPMusicPlayerController : MPMediaPlayback { NSString VolumeDidChangeNotification { get; } } +#if !MONOMAC [NoTV] [BaseType (typeof (UIView))] interface MPVolumeView { @@ -1234,7 +1279,9 @@ interface MPVolumeView { [Field ("MPVolumeViewWirelessRouteActiveDidChangeNotification")] NSString WirelessRouteActiveDidChangeNotification { get; } } +#endif + [NoMac] [NoTV] [Since (4,2)] [BaseType (typeof (NSObject))] @@ -1248,6 +1295,7 @@ interface MPMediaQuerySection : NSSecureCoding, NSCopying { string Title { get; } } + [Mac (10,12,2)] [Since (5,0)] [BaseType (typeof (NSObject))] // Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -init is not supported, use +defaultCenter @@ -1260,6 +1308,11 @@ interface MPNowPlayingInfoCenter { [Export ("defaultCenter")] MPNowPlayingInfoCenter DefaultCenter { get; } + [NoiOS] + [NoTV] + [Export ("playbackState", ArgumentSemantic.Assign)] + MPNowPlayingPlaybackState PlaybackState { get; set; } + [Internal] [Field ("MPNowPlayingInfoPropertyElapsedPlaybackTime")] NSString PropertyElapsedPlaybackTime { get; } @@ -1330,6 +1383,7 @@ interface MPNowPlayingInfoCenter { NSString PropertyIsLiveStream { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // crash if used @@ -1354,11 +1408,13 @@ interface MPContentItem { [Export ("title")] string Title { get; set; } + [NoMac] [iOS (10,0)] [TV (10,0)] [Export ("streamingContent")] bool StreamingContent { [Bind ("isStreamingContent")] get; set; } + [NoMac] [iOS (10,0)] [TV (10,0)] [Export ("explicitContent")] @@ -1371,6 +1427,7 @@ interface MPContentItem { bool Playable { [Bind ("isPlayable")] get; set; } } + [NoMac] [NoTV] [Since (7,1)] [BaseType (typeof (NSObject))] @@ -1400,6 +1457,7 @@ interface MPPlayableContentDataSource { [Export ("numberOfChildItemsAtIndexPath:")] nint NumberOfChildItems (NSIndexPath indexPath); + [NoMac] [iOS (10,0)] [Async] [Export ("contentItemForIdentifier:completionHandler:")] @@ -1409,6 +1467,7 @@ interface MPPlayableContentDataSource { interface IMPPlayableContentDataSource { } + [NoMac] [NoTV] [Since (7,1)] [BaseType (typeof (NSObject))] @@ -1432,6 +1491,7 @@ interface MPPlayableContentDelegate { void InitializePlaybackQueue (MPPlayableContentManager contentManager, [NullAllowed] MPContentItem[] contentItems, Action completionHandler); } + [NoMac] [NoTV] [Since (7,1)] [BaseType (typeof (NSObject))] @@ -1474,6 +1534,7 @@ interface MPPlayableContentManager { string[] NowPlayingIdentifiers { get; set; } } + [NoMac] [NoTV] [iOS (8,4)] [BaseType (typeof(NSObject))] @@ -1497,6 +1558,7 @@ interface MPPlayableContentManagerContext { bool EndpointAvailable { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // NSGenericException Reason: MPRemoteCommands cannot be initialized externally. @@ -1518,6 +1580,7 @@ interface MPRemoteCommand { void RemoveTarget ([NullAllowed] NSObject target, Selector action); } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPChangePlaybackRateCommands cannot be initialized externally. @@ -1527,6 +1590,7 @@ interface MPChangePlaybackRateCommand { NSNumber[] SupportedPlaybackRates { get; set; } } + [Mac (10,12,2)] [iOS (8,0)] [BaseType (typeof(MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPChangeShuffleModeCommand cannot be initialized externally. @@ -1536,6 +1600,7 @@ interface MPChangeShuffleModeCommand MPShuffleType CurrentShuffleType { get; set; } } + [Mac (10,12,2)] [iOS (8,0)] [BaseType (typeof(MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPChangeRepeatModeCommand cannot be initialized externally. @@ -1545,6 +1610,7 @@ interface MPChangeRepeatModeCommand MPRepeatType CurrentRepeatType { get; set; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPFeedbackCommands cannot be initialized externally. @@ -1556,11 +1622,13 @@ interface MPFeedbackCommand { [Export ("localizedTitle")] string LocalizedTitle { get; set; } + [NoMac] [iOS (8,2)] // added in 8.2, shown as NS_AVAILABLE_IOS(8_0) [Export ("localizedShortTitle")] string LocalizedShortTitle { get; set; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPRatingCommands cannot be initialized externally. @@ -1573,6 +1641,7 @@ interface MPRatingCommand { float MinimumRating { get; set; } /* float, not CGFloat */ } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommand))] [DisableDefaultCtor] // NSGenericException Reason: MPSkipIntervalCommands cannot be initialized externally. @@ -1585,6 +1654,7 @@ interface MPSkipIntervalCommand { NSArray _PreferredIntervals { get; set; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] @@ -1660,6 +1730,7 @@ interface MPRemoteCommandCenter { MPChangePlaybackPositionCommand ChangePlaybackPositionCommand { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // NSGenericException Reason: MPRemoteCommandEvents cannot be initialized externally. @@ -1672,6 +1743,7 @@ interface MPRemoteCommandEvent { double /* NSTimeInterval */ Timestamp { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPChangePlaybackRateCommandEvents cannot be initialized externally. @@ -1681,6 +1753,7 @@ interface MPChangePlaybackRateCommandEvent { float PlaybackRate { get; } // float, not CGFloat } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPRatingCommandEvents cannot be initialized externally. @@ -1690,6 +1763,7 @@ interface MPRatingCommandEvent { float Rating { get; } // float, not CGFloat } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // Name: NSGenericException Reason: MPSeekCommandEvents cannot be initialized externally. @@ -1699,6 +1773,7 @@ interface MPSeekCommandEvent { MPSeekCommandEventType Type { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPSkipIntervalCommandEvents cannot be initialized externally. @@ -1708,6 +1783,7 @@ interface MPSkipIntervalCommandEvent { double /* NSTimeInterval */ Interval { get; } } + [Mac (10,12,2)] [Since (7,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] @@ -1717,6 +1793,7 @@ interface MPFeedbackCommandEvent { bool Negative { [Bind ("isNegative")] get; } } + [Mac (10,12,2)] [iOS (9,0)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPChangeLanguageOptionCommandEvents cannot be initialized externally. @@ -1730,6 +1807,7 @@ interface MPChangeLanguageOptionCommandEvent { MPChangeLanguageOptionSetting Setting { get; } } + [Mac (10,12,2)] [iOS (8,0)] [BaseType (typeof(MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPChangeShuffleModeCommandEvent cannot be initialized externally. @@ -1744,6 +1822,7 @@ interface MPChangeShuffleModeCommandEvent bool PreservesShuffleMode { get; } } + [Mac (10,12,2)] [iOS (8,0)] [BaseType (typeof(MPRemoteCommandEvent))] [DisableDefaultCtor] // NSGenericException Reason: MPChangeRepeatModeCommandEvent cannot be initialized externally. @@ -1758,6 +1837,7 @@ interface MPChangeRepeatModeCommandEvent bool PreservesRepeatMode { get; } } + [Mac (10,12,2)] [iOS (9,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // pre-emptive @@ -1790,6 +1870,7 @@ interface MPNowPlayingInfoLanguageOption { bool IsAutomaticAudibleLanguageOption { get; } } + [Mac (10,12,2)] [iOS (9,0)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] // pre-emptive @@ -1807,6 +1888,7 @@ interface MPNowPlayingInfoLanguageOptionGroup { bool AllowEmptySelection { get; } } + [Mac (10,12,2)] [iOS (9,0)] [Static] // not [Internal] since they are exposed as an NSString[] property in MPNowPlayingInfoLanguageOption @@ -1842,12 +1924,14 @@ interface MPLanguageOptionCharacteristics { NSString VoiceOverTranslation { get; } } + [Mac (10,12,2)] [iOS (9,1)] [BaseType (typeof (MPRemoteCommand))] [DisableDefaultCtor] // Objective-C exception thrown. Name: NSGenericException Reason: MPChangePlaybackPositionCommands cannot be initialized externally. interface MPChangePlaybackPositionCommand { } + [Mac (10,12,2)] [iOS (9,1)] [BaseType (typeof (MPRemoteCommandEvent))] [DisableDefaultCtor] // Objective-C exception thrown. Name: NSGenericException Reason: MPChangePlaybackPositionCommandEvents cannot be initialized externally. @@ -1856,6 +1940,7 @@ interface MPChangePlaybackPositionCommandEvent { double PositionTime { get; } } + [NoMac] [NoTV][iOS (9,3)] [BaseType (typeof (NSObject))] [DisableDefaultCtor] @@ -1875,11 +1960,13 @@ interface MPMediaPlaylistCreationMetadata { string DescriptionText { get; set; } } + [NoMac] [NoTV] [iOS (10,1)] [BaseType (typeof (NSObject))] interface MPMusicPlayerQueueDescriptor : NSSecureCoding {} + [NoMac] [NoTV] [iOS (10,1)] [BaseType (typeof(MPMusicPlayerQueueDescriptor))] @@ -1907,6 +1994,7 @@ interface MPMusicPlayerMediaItemQueueDescriptor void SetEndTime (double endTime, MPMediaItem mediaItem); } + [NoMac] [NoTV] [iOS (10,1)] [BaseType (typeof(MPMusicPlayerQueueDescriptor))] diff --git a/src/uikit.cs b/src/uikit.cs index 7a2556d43a0b..4e004ec45be2 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -13108,11 +13108,13 @@ interface UIViewController : NSCoding, UIAppearanceContainer, UIContentContainer UIModalPresentationStyle ModalPresentationStyle { get; set; } // 3.2 extensions from MoviePlayer + [NoMac] [NoTV] [Availability (Introduced = Platform.iOS_3_2, Deprecated = Platform.iOS_9_0)] [Export ("presentMoviePlayerViewControllerAnimated:")] void PresentMoviePlayerViewController (MPMoviePlayerViewController moviePlayerViewController); + [NoMac] [NoTV] [Availability (Introduced = Platform.iOS_3_2, Deprecated = Platform.iOS_9_0)] [Export ("dismissMoviePlayerViewControllerAnimated")] diff --git a/tests/xtro-sharpie/osx.pending b/tests/xtro-sharpie/osx.pending index f931e4e15572..923b812a6d58 100644 --- a/tests/xtro-sharpie/osx.pending +++ b/tests/xtro-sharpie/osx.pending @@ -203,3 +203,59 @@ !missing-type! SFSafariExtensionManager not bound !missing-selector! SFSafariExtensionState::isEnabled not bound !missing-type! SFSafariExtensionState not bound + +# MediaPlayer API macOS 10.12.2 + +# These are not available on macOS even if xtro says so. +!missing-type! MPMediaEntity not bound +!missing-type! MPMediaItem not bound + +!missing-enum! MPErrorCode not bound +!missing-enum! MPMediaType not bound + +!missing-field! MPErrorDomain not bound +!missing-field! MPMediaEntityPropertyPersistentID not bound + +!missing-field! MPMediaItemPropertyAlbumArtist not bound +!missing-field! MPMediaItemPropertyAlbumArtistPersistentID not bound +!missing-field! MPMediaItemPropertyAlbumPersistentID not bound +!missing-field! MPMediaItemPropertyAlbumTitle not bound +!missing-field! MPMediaItemPropertyAlbumTrackCount not bound +!missing-field! MPMediaItemPropertyAlbumTrackNumber not bound +!missing-field! MPMediaItemPropertyArtist not bound +!missing-field! MPMediaItemPropertyArtistPersistentID not bound +!missing-field! MPMediaItemPropertyArtwork not bound +!missing-field! MPMediaItemPropertyAssetURL not bound +!missing-field! MPMediaItemPropertyBeatsPerMinute not bound +!missing-field! MPMediaItemPropertyBookmarkTime not bound +!missing-field! MPMediaItemPropertyComments not bound +!missing-field! MPMediaItemPropertyComposer not bound +!missing-field! MPMediaItemPropertyComposerPersistentID not bound +!missing-field! MPMediaItemPropertyDateAdded not bound +!missing-field! MPMediaItemPropertyDiscCount not bound +!missing-field! MPMediaItemPropertyDiscNumber not bound +!missing-field! MPMediaItemPropertyGenre not bound +!missing-field! MPMediaItemPropertyGenrePersistentID not bound +!missing-field! MPMediaItemPropertyHasProtectedAsset not bound +!missing-field! MPMediaItemPropertyIsCloudItem not bound +!missing-field! MPMediaItemPropertyIsCompilation not bound +!missing-field! MPMediaItemPropertyIsExplicit not bound +!missing-field! MPMediaItemPropertyLastPlayedDate not bound +!missing-field! MPMediaItemPropertyLyrics not bound +!missing-field! MPMediaItemPropertyMediaType not bound +!missing-field! MPMediaItemPropertyPersistentID not bound +!missing-field! MPMediaItemPropertyPlayCount not bound +!missing-field! MPMediaItemPropertyPlaybackDuration not bound +!missing-field! MPMediaItemPropertyPodcastPersistentID not bound +!missing-field! MPMediaItemPropertyPodcastTitle not bound +!missing-field! MPMediaItemPropertyRating not bound +!missing-field! MPMediaItemPropertyReleaseDate not bound +!missing-field! MPMediaItemPropertySkipCount not bound +!missing-field! MPMediaItemPropertyTitle not bound +!missing-field! MPMediaItemPropertyUserGrouping not bound + +!missing-selector! +MPMediaEntity::canFilterByProperty: not bound +!missing-selector! MPMediaEntity::enumerateValuesForProperties:usingBlock: not bound +!missing-selector! MPMediaEntity::objectForKeyedSubscript: not bound +!missing-selector! MPMediaEntity::valueForProperty: not bound +!missing-selector! MPMediaItemArtwork::imageCropRect not bound \ No newline at end of file diff --git a/tools/common/Frameworks.cs b/tools/common/Frameworks.cs index a66974e15dad..fbfa8a5f284c 100644 --- a/tools/common/Frameworks.cs +++ b/tools/common/Frameworks.cs @@ -17,25 +17,30 @@ public class Frameworks : Dictionary { public void Add (string @namespace, int major_version) { - Add (@namespace, @namespace, major_version, 0); + Add (@namespace, @namespace, major_version, 0, 0); } public void Add (string @namespace, string framework, int major_version) { - Add (@namespace, framework, major_version, 0); + Add (@namespace, framework, major_version, 0, 0); } public void Add (string @namespace, int major_version, int minor_version) { - Add (@namespace, @namespace, major_version, minor_version); + Add (@namespace, @namespace, major_version, minor_version, 0); } public void Add (string @namespace, string framework, int major_version, int minor_version) + { + Add(@namespace, framework, major_version, minor_version, 0); + } + + public void Add (string @namespace, string framework, int major_version, int minor_version, int build_version) { var fr = new Framework () { Namespace = Driver.IsUnified ? @namespace : XamCore.Registrar.Registrar.CompatNamespace + "." + @namespace, Name = framework, - Version = new Version (major_version, minor_version) + Version = new Version (major_version, minor_version, build_version) }; base.Add (fr.Namespace, fr); } @@ -127,6 +132,7 @@ public static Frameworks MacFrameworks { { "Intents", 10, 12 }, { "SafariServices", "SafariServices", 10, 12 }, + { "MediaPlayer", "MediaPlayer", 10, 12, 1 }, }; } return mac_frameworks;