Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mediaplayer] Enable MediaPlayer on macOS #1138

Merged
merged 2 commits into from
Nov 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Constants.mac.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
2 changes: 1 addition & 1 deletion src/MediaPlayer/MPMediaItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Copyright 2011-2012 Xamarin, Inc
//

#if !TVOS
#if !TVOS && !MONOMAC

using System;
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion src/MediaPlayer/MPMediaQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// Copyright 2011-2012, 2014-2015 Xamarin, Inc
//

#if !TVOS
#if !TVOS && !MONOMAC

using System;
using XamCore.Foundation;
Expand Down
2 changes: 1 addition & 1 deletion src/MediaPlayer/MPNowPlayingInfoCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Copyright 2011, Xamarin Inc
//

#if !TVOS
#if !TVOS && !MONOMAC

using XamCore.Foundation;
using XamCore.ObjCRuntime;
Expand Down
2 changes: 1 addition & 1 deletion src/MediaPlayer/MPPlayableContentDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !XAMCORE_3_0
#if !XAMCORE_3_0 && !MONOMAC

using System;
using XamCore.Foundation;
Expand Down
2 changes: 1 addition & 1 deletion src/MediaPlayer/MPVolumeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright 2011-2015 Xamarin, Inc.
//

#if !TVOS
#if !TVOS && !MONOMAC

using System;
using System.Runtime.InteropServices;
Expand Down
39 changes: 39 additions & 0 deletions src/MediaPlayer/MediaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace XamCore.MediaPlayer {

// NSInteger -> MPMoviePlayerController.h
[Native]
[NoMac]
[NoTV]
public enum MPMoviePlaybackState : nint {
Stopped,
Expand All @@ -28,6 +29,7 @@ public enum MPMoviePlaybackState : nint {

// NSInteger -> MPMoviePlayerController.h
[Native]
[NoMac]
[NoTV]
public enum MPMovieLoadState : nint {
Unknown = 0,
Expand All @@ -37,6 +39,7 @@ public enum MPMovieLoadState : nint {
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -46,13 +49,15 @@ public enum MPMovieRepeatMode : nint {

// NSInteger -> MPMoviePlayerController.h
[Native]
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
public enum MPMovieControlStyle : nint {
None, Embedded, Fullscreen, Default = Embedded
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -61,6 +66,7 @@ public enum MPMovieFinishReason : nint {
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -72,6 +78,7 @@ public enum MPMovieMediaType : nint {
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -80,6 +87,7 @@ public enum MPMovieSourceType : nint {
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -89,6 +97,7 @@ public enum MPMovieTimeOption : nint {
}

// NSUInteger -> MPMediaItem.h
[NoMac]
[Native]
[Flags]
[NoTV]
Expand Down Expand Up @@ -131,6 +140,7 @@ public enum MPMediaType : nuint_compat_int {
}

// NSInteger -> MPMediaPlaylist.h
[NoMac]
[Native]
[Flags]
[NoTV]
Expand All @@ -143,6 +153,7 @@ public enum MPMediaPlaylistAttribute : nint {

// NSInteger -> MPMediaQuery.h
[Native]
[NoMac]
[NoTV]
public enum MPMediaGrouping : nint {
Title,
Expand All @@ -157,13 +168,15 @@ public enum MPMediaGrouping : nint {

// NSInteger -> MPMediaQuery.h
[Native]
[NoMac]
[NoTV]
public enum MPMediaPredicateComparison : nint {
EqualsTo,
Contains
}

// NSInteger -> MPMoviePlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -175,13 +188,15 @@ public enum MPMovieScalingMode : nint {
}

// untyped enum -> MPMoviePlayerController.h
[NoMac]
public enum MPMovieControlMode {
Default,
VolumeOnly,
Hidden
}

// NSInteger -> /MPMusicPlayerController.h
[NoMac]
[NoTV]
[Availability (Deprecated = Platform.iOS_9_0)]
[Native]
Expand All @@ -196,6 +211,7 @@ public enum MPMusicPlaybackState : nint {

// NSInteger -> /MPMusicPlayerController.h
[Native]
[NoMac]
[NoTV]
public enum MPMusicRepeatMode : nint {
Default,
Expand All @@ -206,6 +222,7 @@ public enum MPMusicRepeatMode : nint {

// NSInteger -> /MPMusicPlayerController.h
[Native]
[NoMac]
[NoTV]
public enum MPMusicShuffleMode : nint {
Default,
Expand All @@ -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
{
Expand All @@ -224,6 +242,7 @@ public enum MPShuffleType : nint
Collections
}

[Mac (10,12,2)]
[Native]
public enum MPRepeatType : nint
{
Expand All @@ -232,6 +251,7 @@ public enum MPRepeatType : nint
All
}

[Mac (10,12,2)]
[iOS (10,0)]
[Native]
public enum MPChangeLanguageOptionSetting : nint
Expand All @@ -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,
Expand All @@ -254,19 +275,22 @@ 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 {
Audible,
Legible
}

[NoMac]
[iOS (9,3)]
[Native]
[ErrorDomain ("MPErrorDomain")]
Expand All @@ -281,6 +305,7 @@ public enum MPErrorCode : nint {
Cancelled,
}

[NoMac]
[NoTV]
[iOS (9,3)]
[Native]
Expand All @@ -291,6 +316,7 @@ public enum MPMediaLibraryAuthorizationStatus : nint {
Authorized
}

[Mac (10,12,2)]
[iOS (10,0)]
[Native]
public enum MPNowPlayingInfoMediaType : nuint
Expand All @@ -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,
}

}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,7 @@ MAC_FRAMEWORKS = \
MapKit \
MediaAccessibility \
MediaLibrary \
MediaPlayer \
MediaToolbox \
Metal \
MetalKit \
Expand Down
Loading