Skip to content

Commit

Permalink
[Cinematic] Add support for Xcode 15 beta 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque committed Aug 15, 2023
1 parent 7988d05 commit d0b3ba2
Show file tree
Hide file tree
Showing 20 changed files with 573 additions and 816 deletions.
45 changes: 45 additions & 0 deletions src/Cinematic/CNDecision.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using CoreMedia;
using Foundation;
using ObjCRuntime;

#nullable enable

#if !WATCH

namespace Cinematic {

#if NET
[UnsupportedOSPlatform ("watchos")]
[UnsupportedOSPlatform ("tvos17.0")]
[SupportedOSPlatform ("macos14.0")]
[SupportedOSPlatform ("ios17.0")]
[SupportedOSPlatform ("maccatalyst17.0")]
#else
[NoWatch, TV (17, 0), Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
#endif
public enum CNDecisionIdentifierType {
Single,
Group,
}

public partial class CNDecision {

public CNDecision (CMTime time, long detectionID, bool isStrong, CNDecisionIdentifierType identifierType)
{

switch (identifierType) {
case CNDecisionIdentifierType.Single:
InitializeHandle (_InitWithSingleIdentifier (time, detectionID, isStrong), "initWithTime:detectionID:strong:");
break;
case CNDecisionIdentifierType.Group:
InitializeHandle (_InitWithGroupIdentifier (time, detectionID, isStrong), "initWithTime:detectionGroupID:strong:");
break;
default:
ObjCRuntime.ThrowHelper.ThrowArgumentOutOfRangeException (nameof (identifierType), $"Unknown identifier type: {identifierType}");
break;
}
}
}
}
#endif
9 changes: 9 additions & 0 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
using CoreAnimation;
using CoreImage;
using MediaToolbox;
using Cinematic;
#else
// hack: ease compilation without extra defines
using CIBarcodeDescriptor = Foundation.NSObject;
using CNAssetInfo = Foundation.NSObject;
using CNCompositionInfo = Foundation.NSObject;
#endif
using AudioToolbox;
using CoreMedia;
Expand Down Expand Up @@ -8335,6 +8338,7 @@ interface AVMutableCompositionTrack {
[MacCatalyst (13, 1)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }

}

[Watch (6, 0)]
Expand Down Expand Up @@ -8490,6 +8494,11 @@ interface AVMutableComposition {
[Export ("naturalSize")]
[Override]
CGSize NaturalSize { get; set; }

// from @interface CNComposition (AVMutableComposition)
[TV (17, 0), NoWatch, Mac (14, 0), iOS (17, 0), MacCatalyst (17, 0)]
[Export ("addTracksForCinematicAssetInfo:preferredStartingTrackID:")]
CNCompositionInfo AddTracks (CNAssetInfo assetInfo, int preferredStartingTrackID);
}

[Watch (6, 0)]
Expand Down
Loading

0 comments on commit d0b3ba2

Please sign in to comment.