Class CNScript

  • All Implemented Interfaces:
    NSObject

    public class CNScript
    extends NSObject
    Database of focus decisions with methods to change them. Knows what has been detected in each frame and which detection is being focused on. All operations are executed in a thread-safe manner, but that also means that a long-running update can stall a lookup. Best practice is to lookup what you need up front (outside your critical code) and pass the immutable results to where it's needed. That way, you're not blocked when you access the information, say inside the rendering portion of your code. API-Since: 17.0
    • Constructor Detail

      • CNScript

        protected CNScript​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • addDetectionTrack

        public long addDetectionTrack​(@NotNull
                                      @NotNull CNDetectionTrack detectionTrack)
        Add user created detection track. - Returns: the detectionID assigned to the added track, which can be used for later lookup or decision creation.
      • addUserDecision

        public boolean addUserDecision​(@NotNull
                                       @NotNull CNDecision decision)
        Add a new user decision. Replaces an existing user decision if the times are identical. Adding a decision can fail if the decision focuses on an detection or group that does not exist or if its time is not within the time range of the cinematic script. - Returns: whether adding was successful
      • addedDetectionTracks

        @NotNull
        public @NotNull NSArray<? extends CNDetectionTrack> addedDetectionTracks()
        All detection tracks that have been added since recording.
      • alloc

        public static CNScript alloc()
      • allocWithZone

        public static CNScript allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • baseDecisionsInTimeRange

        @NotNull
        public @NotNull NSArray<? extends CNDecision> baseDecisionsInTimeRange​(CMTimeRange timeRange)
        All base decisions made automatically during recording in the given time range. These apply if no user decision overrides them.
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • changes

        @NotNull
        public @NotNull CNScriptChanges changes()
        Changes made since cinematic asset was recorded. Can be used to checkpoint and later restore changes made so far.
      • changesTrimmedByTimeRange

        @NotNull
        public @NotNull CNScriptChanges changesTrimmedByTimeRange​(CMTimeRange timeRange)
        Changes trimmed and time range shifted to start at zero — for use with a similarly trimmed cinematic asset.
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • decisionAfterTime

        @Nullable
        public @Nullable CNDecision decisionAfterTime​(CMTime time)
        The decision that occurs after the given time. Pass the time of an existing decision to find the next one.
      • decisionAtTimeTolerance

        @Nullable
        public @Nullable CNDecision decisionAtTimeTolerance​(CMTime time,
                                                            CMTime tolerance)
        The closest decision to the given time within the given tolerance. Returns `nil` if there are none.
      • decisionBeforeTime

        @Nullable
        public @Nullable CNDecision decisionBeforeTime​(CMTime time)
        The decision that occurs before the given time. Pass the time of an existing decisions to find the previous one.
      • decisionsInTimeRange

        @NotNull
        public @NotNull NSArray<? extends CNDecision> decisionsInTimeRange​(CMTimeRange timeRange)
        All decisions within the given time range.
      • description_static

        public static java.lang.String description_static()
      • detectionTrackForDecision

        @Nullable
        public @Nullable CNDetectionTrack detectionTrackForDecision​(@NotNull
                                                                    @NotNull CNDecision decision)
        A detection track representing all detections that would be chosen by a given decision.
      • detectionTrackForID

        @Nullable
        public @Nullable CNDetectionTrack detectionTrackForID​(long detectionID)
        A detection track representing all detections with the given detectionID over the entire cinematic script.
      • fNumber

        public float fNumber()
        The f/number to apply to the entire movie, initially set to that of the recorded movie. Pass this to the rendering session in the rendering frame attributes to match the selected aperture. Change this property when the user selects a different aperture for the edited movie. Changes to this property are reflected in the script changes for later restoration.
      • frameAtTimeTolerance

        @Nullable
        public @Nullable CNScriptFrame frameAtTimeTolerance​(CMTime time,
                                                            CMTime tolerance)
        The closest frame to the given time within the given tolerance. Returns `nil` if there are none.
      • framesInTimeRange

        @NotNull
        public @NotNull NSArray<? extends CNScriptFrame> framesInTimeRange​(CMTimeRange timeRange)
        All frames within the given time range.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • loadFromAssetChangesProgressCompletionHandler

        public static void loadFromAssetChangesProgressCompletionHandler​(@NotNull
                                                                         @NotNull AVAsset asset,
                                                                         @Nullable
                                                                         @Nullable CNScriptChanges changes,
                                                                         @Nullable
                                                                         @Nullable NSProgress progress,
                                                                         @NotNull
                                                                         @NotNull CNScript.Block_loadFromAssetChangesProgressCompletionHandler completionHandler)
        Load cinematic script asynchronously from a cinematic asset. - Parameters: - asset: the cinematic asset to be loaded. - changes: optional changes since asset was recorded. Can be obtained from a previous editing session. If `nil`, the asset is loaded as originally recorded. - progress: optional progress object to track progress or cancel loading. Represents just the loading of this asset. Create with desired total unit count or use zero to have the unit count filled in automatically. If `nil`, no progress is reported. - completionHandler: called with the loaded cinematic script when done, or with with an error if it fails. If progress is canceled before it completes, the completion handler is called with an error.
      • new_objc

        public static CNScript new_objc()
      • primaryDecisionAtTime

        @Nullable
        public @Nullable CNDecision primaryDecisionAtTime​(CMTime time)
        The primary decision that is in effect at the specified time, unless if it's outside the time range of the cinematic script. Also represents the decision that is being transitioned away from if the given time is during a focus transition.
      • reloadWithChanges

        public void reloadWithChanges​(@Nullable
                                      @Nullable CNScriptChanges changes)
        Reload the cinematic script with optional changes applied, removing any previous changes made. This can be more efficient than loading the asset from scratch. - Parameters: - changes: optional changes since asset was recorded. Can be obtained from a previous editing session. If `nil`, the asset is reloaded as originally recorded.
      • removeAllUserDecisions

        public void removeAllUserDecisions()
        Remove all user decisions and revert to base decisions only.
      • removeDetectionTrack

        public boolean removeDetectionTrack​(@NotNull
                                            @NotNull CNDetectionTrack detectionTrack)
        Remove user created detection track. Tracks created at recording time cannot be removed. - Returns: whether removal was successful
      • removeUserDecision

        public boolean removeUserDecision​(@NotNull
                                          @NotNull CNDecision decision)
        Remove an existing user decision. User decisions added to the script or those made at recording time (by tapping during recording) can be removed. Decisions that are not user decisions cannot be removed. - Returns: whether removal was successful
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • secondaryDecisionAtTime

        @Nullable
        public @Nullable CNDecision secondaryDecisionAtTime​(CMTime time)
        The secondary decision that is being transitioned towards if the given time is during a focus transition.
      • setFNumber

        public void setFNumber​(float value)
        The f/number to apply to the entire movie, initially set to that of the recorded movie. Pass this to the rendering session in the rendering frame attributes to match the selected aperture. Change this property when the user selects a different aperture for the edited movie. Changes to this property are reflected in the script changes for later restoration.
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • timeRange

        public CMTimeRange timeRange()
        The time range of the cinematic asset. All frames, decisions, and detections are within this time range.
      • timeRangeOfTransitionAfterDecision

        public CMTimeRange timeRangeOfTransitionAfterDecision​(@NotNull
                                                              @NotNull CNDecision decision)
        The time range during which the focus transition away from the given decision occurs.
      • timeRangeOfTransitionBeforeDecision

        public CMTimeRange timeRangeOfTransitionBeforeDecision​(@NotNull
                                                               @NotNull CNDecision decision)
        The time range during which the focus transition towards the given decision occurs.
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.
      • userDecisionsInTimeRange

        @NotNull
        public @NotNull NSArray<? extends CNDecision> userDecisionsInTimeRange​(CMTimeRange timeRange)
        All user decisions in the given time range. Includes user decisions made during recording or added to the script.
      • version_static

        public static long version_static()