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

[Cinematic] Add support for Xcode 15 beta 6. #18686

Merged
Merged
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 && !__MACCATALYST__

namespace Cinematic {

#if NET
[SupportedOSPlatform ("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)
: base (NSObjectFlag.Empty)
{

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
15 changes: 15 additions & 0 deletions src/avfoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
// hack: ease compilation without extra defines
using CIBarcodeDescriptor = Foundation.NSObject;
#endif

// cinematic is not present in certain platforms
#if WATCH || __MACCATALYST__
using CNAssetInfo = Foundation.NSObject;
using CNCompositionInfo = Foundation.NSObject;
#else
using Cinematic;
#endif

using AudioToolbox;
using CoreMedia;
using ObjCRuntime;
Expand Down Expand Up @@ -8335,6 +8344,7 @@ interface AVMutableCompositionTrack {
[MacCatalyst (13, 1)]
[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }

}

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

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

[Watch (6, 0)]
Expand Down
Loading
Loading