open class AKClipMerger: NSObject
AKClipMerger merges new clips into an existing array of validated clips and returns a new array of validated clips including the new clip.
- The clip itself must be valid as defined by the clip’s isValid function.
- The clips in the array must not overlap each other (clip.time + clip.duration <= nextClip.time).
The strategy used when a new clip overlaps an existing clip is last-in precedence. Existing clips will shortened, split, or removed in order to make room for the new clip. Since clips can be split or removed, merging a clip may result in the clip count decreasing when a clip is merged, or increasing by more than 1. This behavior requires that the clip merger create clips, so to facilitate this need it uses a delegate. When a clip is to be shortened, it is removed from the existing clips, and a new clip is created using the delegate’s newClip function. When a clip is to be split, the original is removed and newClip will be called twice. When a clip is removed, the delegate’s clipWillBeRemoved function will be called (if implemented).
The delegate used for clip editing and creation.
open weak var mergeDelegate: ClipMergeDelegate?
Creates a validated array of clips with the new clip merged into an array of validated clips.
The clip to be merged
A validated clip array.
A validated array of clips containing the new clip merged with clips.