-
Notifications
You must be signed in to change notification settings - Fork 514
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
[ShazamKit] Updates Xcode13 beta1 #12189
Merged
tj-devel709
merged 23 commits into
xamarin:main
from
tj-devel709:Xcode13-ShazamKit-beta1
Aug 17, 2021
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
88b1f61
initial changes
f4aefd2
forgot a comma
92812fa
adding common ignore and new framework locations
7ec97c4
fixing capitalization and adding DisableDefaultConstructor
0003b4a
newlines in attributes
59232d9
Merge branch 'main' into Xcode13-ShazamKit-beta1
mandel-macaque db776fb
Merge remote-tracking branch 'xamarin/main' into Xcode13-ShazamKit-beta1
c25ee39
run tests on device only
dc06158
Merge remote-tracking branch 'TJ/Xcode13-ShazamKit-beta1' into Xcode1…
d1eb2f6
name changes and checking for simulator
e7b0874
Merge branch 'main' into Xcode13-ShazamKit-beta1
tj-devel709 5cff855
Merge remote-tracking branch 'xamarin/main' into Xcode13-ShazamKit-beta1
5aff644
forgot unavailable for swift
d369c6f
Merge remote-tracking branch 'TJ/Xcode13-ShazamKit-beta1' into Xcode1…
3b1d577
removing decoration
2960e20
syntax
96eb3ff
wrong line and adding in default constructor
956b8a9
Merge remote-tracking branch 'xamarin/main' into Xcode13-ShazamKit-beta1
9d43b29
alphabetical
f51f4d6
fixing tests
0b79901
Adding Simulator only in Frameworks.cs
acb7bf4
Merge remote-tracking branch 'xamarin/main' into Xcode13-ShazamKit-beta1
a8c1bc2
removing unnecessary attributes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,267 @@ | ||
using System; | ||
using CoreGraphics; | ||
using Foundation; | ||
using ObjCRuntime; | ||
using AVFoundation; | ||
|
||
namespace ShazamKit { | ||
|
||
[Native] | ||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[ErrorDomain ("SHErrorDomain")] | ||
public enum SHErrorCode : long | ||
{ | ||
InvalidAudioFormat = 100, | ||
AudioDiscontinuity = 101, | ||
SignatureInvalid = 200, | ||
SignatureDurationInvalid = 201, | ||
MatchAttemptFailed = 202, | ||
CustomCatalogInvalid = 300, | ||
CustomCatalogInvalidURL = 301, | ||
MediaLibrarySyncFailed = 400, | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[Static] | ||
enum SHMediaItemProperty | ||
{ | ||
[Field ("SHMediaItemShazamID")] | ||
ShazamId, | ||
[Field ("SHMediaItemTitle")] | ||
Title, | ||
[Field ("SHMediaItemSubtitle")] | ||
Subtitle, | ||
[Field ("SHMediaItemArtist")] | ||
Artist, | ||
[Field ("SHMediaItemWebURL")] | ||
WebUrl, | ||
[Field ("SHMediaItemAppleMusicID")] | ||
AppleMusicId, | ||
[Field ("SHMediaItemAppleMusicURL")] | ||
AppleMusicUrl, | ||
[Field ("SHMediaItemArtworkURL")] | ||
ArtworkUrl, | ||
[Field ("SHMediaItemVideoURL")] | ||
VideoUrl, | ||
[Field ("SHMediaItemExplicitContent")] | ||
ExplicitContent, | ||
[Field ("SHMediaItemGenres")] | ||
Genres, | ||
[Field ("SHMediaItemISRC")] | ||
Isrc, | ||
[Field ("SHMediaItemMatchOffset")] | ||
MatchOffset, | ||
[Field ("SHMediaItemFrequencySkew")] | ||
FrequencySkew, | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface SHCatalog | ||
{ | ||
[Export ("minimumQuerySignatureDuration")] | ||
double MinimumQuerySignatureDuration { get; } | ||
|
||
[Export ("maximumQuerySignatureDuration")] | ||
double MaximumQuerySignatureDuration { get; } | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (SHCatalog))] | ||
interface SHCustomCatalog | ||
{ | ||
[Export ("addReferenceSignature:representingMediaItems:error:")] | ||
bool Add (SHSignature signature, SHMediaItem[] mediaItems, [NullAllowed] out NSError error); | ||
|
||
[Export ("addCustomCatalogFromURL:error:")] | ||
bool Add (NSUrl url, [NullAllowed] out NSError error); | ||
|
||
[Export ("writeToURL:error:")] | ||
bool Write (NSUrl url, [NullAllowed] out NSError error); | ||
|
||
[Static] | ||
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0)] | ||
[Export ("new")] | ||
[return: Release] | ||
tj-devel709 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
SHCustomCatalog Create (); | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface SHMatch : NSSecureCoding | ||
{ | ||
[Export ("mediaItems", ArgumentSemantic.Strong)] | ||
SHMatchedMediaItem[] MediaItems { get; } | ||
|
||
[Export ("querySignature", ArgumentSemantic.Strong)] | ||
SHSignature QuerySignature { get; } | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (SHMediaItem))] | ||
tj-devel709 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[DisableDefaultCtor] | ||
interface SHMatchedMediaItem : NSSecureCoding | ||
{ | ||
[Export ("frequencySkew")] | ||
float FrequencySkew { get; } | ||
|
||
[Export ("matchOffset")] | ||
double MatchOffset { get; } | ||
|
||
[Export ("predictedCurrentMatchOffset")] | ||
double PredictedCurrentMatchOffset { get; } | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface SHMediaItem : NSSecureCoding, NSCopying | ||
{ | ||
[NullAllowed] | ||
[Export ("shazamID")] | ||
string ShazamId { get; } | ||
|
||
[NullAllowed] | ||
[Export ("title")] | ||
string Title { get; } | ||
|
||
[NullAllowed] | ||
[Export ("subtitle")] | ||
string Subtitle { get; } | ||
|
||
[NullAllowed] | ||
[Export ("artist")] | ||
string Artist { get; } | ||
|
||
[Export ("genres", ArgumentSemantic.Strong)] | ||
string[] Genres { get; } | ||
|
||
[NullAllowed] | ||
[Export ("appleMusicID")] | ||
string AppleMusicId { get; } | ||
|
||
[NullAllowed] | ||
[Export ("appleMusicURL", ArgumentSemantic.Strong)] | ||
NSUrl AppleMusicUrl { get; } | ||
|
||
[NullAllowed] | ||
[Export ("webURL", ArgumentSemantic.Strong)] | ||
NSUrl WebUrl { get; } | ||
|
||
[NullAllowed] | ||
[Export ("artworkURL", ArgumentSemantic.Strong)] | ||
NSUrl ArtworkUrl { get; } | ||
|
||
[NullAllowed] | ||
[Export ("videoURL", ArgumentSemantic.Strong)] | ||
NSUrl VideoUrl { get; } | ||
|
||
[Export ("explicitContent")] | ||
bool ExplicitContent { get; } | ||
|
||
[NullAllowed] | ||
[Export ("isrc")] | ||
string Isrc { get; } | ||
|
||
[Static] | ||
[Export ("mediaItemWithProperties:")] | ||
SHMediaItem Create (NSDictionary<NSString, NSObject> properties); | ||
|
||
[Async] | ||
[Static] | ||
[Export ("fetchMediaItemWithShazamID:completionHandler:")] | ||
void FetchMediaItem (string shazamId, Action<SHMediaItem, NSError> completionHandler); | ||
|
||
[Export ("valueForProperty:")] | ||
NSObject GetValue (string property); | ||
|
||
[Export ("objectForKeyedSubscript:")] | ||
NSObject GetObject (string key); | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface SHMediaLibrary | ||
{ | ||
[Static] | ||
[Export ("defaultLibrary", ArgumentSemantic.Strong)] | ||
SHMediaLibrary DefaultLibrary { get; } | ||
spouliot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[Async] | ||
[Export ("addMediaItems:completionHandler:")] | ||
void Add (SHMediaItem[] mediaItems, Action<NSError> completionHandler); | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
tj-devel709 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
interface SHSession | ||
{ | ||
[Export ("catalog", ArgumentSemantic.Strong)] | ||
SHCatalog Catalog { get; } | ||
|
||
[Wrap ("WeakDelegate")] | ||
[NullAllowed] | ||
ISHSessionDelegate Delegate { get; set; } | ||
|
||
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] | ||
NSObject WeakDelegate { get; set; } | ||
|
||
[Export ("initWithCatalog:")] | ||
IntPtr Constructor (SHCatalog catalog); | ||
|
||
[Export ("matchStreamingBuffer:atTime:")] | ||
void Match (AVAudioPcmBuffer buffer, [NullAllowed] AVAudioTime time); | ||
|
||
[Export ("matchSignature:")] | ||
void Match (SHSignature signature); | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
tj-devel709 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[DisableDefaultCtor] | ||
interface SHSignature : NSSecureCoding, NSCopying | ||
{ | ||
[Export ("initWithDataRepresentation:error:")] | ||
[DesignatedInitializer] | ||
IntPtr Constructor (NSData dataRepresentation, [NullAllowed] out NSError error); | ||
|
||
[Export ("duration")] | ||
double Duration { get; } | ||
|
||
[Export ("dataRepresentation", ArgumentSemantic.Strong)] | ||
NSData DataRepresentation { get; } | ||
|
||
[Static] | ||
[Export ("signatureWithDataRepresentation:error:")] | ||
[return: NullAllowed] | ||
SHSignature GetSignature (NSData dataRepresentation, [NullAllowed] out NSError error); | ||
} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof (NSObject))] | ||
interface SHSignatureGenerator | ||
{ | ||
[Export ("appendBuffer:atTime:error:")] | ||
bool Append (AVAudioPcmBuffer buffer, [NullAllowed] AVAudioTime time, [NullAllowed] out NSError error); | ||
|
||
[Export ("signature")] | ||
SHSignature Signature { get; } | ||
} | ||
|
||
interface ISHSessionDelegate {} | ||
|
||
[iOS (15,0), Mac (12,0), Watch (8,0), TV (15,0), MacCatalyst (15,0)] | ||
[Protocol, Model (AutoGeneratedName = true)] | ||
[BaseType (typeof (NSObject))] | ||
interface SHSessionDelegate | ||
{ | ||
[Export ("session:didFindMatch:")] | ||
void DidFindMatch (SHSession session, SHMatch match); | ||
|
||
[Export ("session:didNotFindMatchForSignature:error:")] | ||
void DidNotFindMatch (SHSession session, SHSignature signature, [NullAllowed] NSError error); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ that's a (incomplete) duplicate of the attributes on the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Removing now!