static void UpdateClipIntersection(TimelineClip blendOutClip, TimelineClip blendInClip)
        {
            if (!blendOutClip.SupportsBlending() || !blendInClip.SupportsBlending())
            {
                return;
            }

            if (blendInClip.start - blendOutClip.start < blendOutClip.duration - blendInClip.duration)
            {
                return;
            }

            double duration = Math.Max(0, blendOutClip.start + blendOutClip.duration - blendInClip.start);

            duration = duration <= kMinOverlapTime ? 0 : duration;
            blendOutClip.blendOutDuration = duration;
            blendInClip.blendInDuration   = duration;

            var blendInMode  = blendInClip.blendInCurveMode;
            var blendOutMode = blendOutClip.blendOutCurveMode;

            if (blendInMode == TimelineClip.BlendCurveMode.Manual && blendOutMode == TimelineClip.BlendCurveMode.Auto)
            {
                blendOutClip.mixOutCurve = CurveEditUtility.CreateMatchingCurve(blendInClip.mixInCurve);
            }
            else if (blendInMode == TimelineClip.BlendCurveMode.Auto && blendOutMode == TimelineClip.BlendCurveMode.Manual)
            {
                blendInClip.mixInCurve = CurveEditUtility.CreateMatchingCurve(blendOutClip.mixOutCurve);
            }
            else if (blendInMode == TimelineClip.BlendCurveMode.Auto && blendOutMode == TimelineClip.BlendCurveMode.Auto)
            {
                blendInClip.mixInCurve   = null; // resets to default curves
                blendOutClip.mixOutCurve = null;
            }
        }
        private ClipInspector.SelectionInfo BuildSelectionInfo()
        {
            ClipInspector.SelectionInfo result = new ClipInspector.SelectionInfo
            {
                supportsBlending        = true,
                supportsClipIn          = true,
                supportsExtrapolation   = true,
                supportsSpeedMultiplier = true,
                hasBlendIn  = true,
                hasBlendOut = true,
                selectedAssetTypesAreHomogeneous = true
            };
            HashSet <TrackAsset> hashSet = new HashSet <TrackAsset>();
            Object @object = (!this.m_SelectionCache.Any <ClipInspector.EditorClipSelection>()) ? null : this.m_SelectionCache.First <ClipInspector.EditorClipSelection>().clip.asset;
            Type   type    = (!(@object != null)) ? null : @object.GetType();

            foreach (ClipInspector.EditorClipSelection current in this.m_SelectionCache)
            {
                TimelineClip clip = current.clip;
                result.supportsBlending        &= clip.SupportsBlending();
                result.supportsClipIn          &= clip.SupportsClipIn();
                result.supportsExtrapolation   &= clip.SupportsExtrapolation();
                result.supportsSpeedMultiplier &= clip.SupportsSpeedMultiplier();
                result.hasBlendIn  &= clip.hasBlendIn;
                result.hasBlendOut &= clip.hasBlendOut;
                result.selectedAssetTypesAreHomogeneous &= (clip.asset.GetType() == type);
                hashSet.Add(clip.parentTrack);
            }
            result.selectionContainsAtLeastTwoClipsOnTheSameTrack = (hashSet.Count != this.m_SelectionCache.Count <ClipInspector.EditorClipSelection>());
            return(result);
        }
 void UpdateClipCaps(TimelineClip clip)
 {
     supportsBlending        &= clip.SupportsBlending();
     supportsClipIn          &= clip.SupportsClipIn();
     supportsExtrapolation   &= clip.SupportsExtrapolation();
     supportsSpeedMultiplier &= clip.SupportsSpeedMultiplier();
 }
 internal static void UpdateClipIntersection(TimelineClip blendOutClip, TimelineClip blendInClip)
 {
     if (blendOutClip.SupportsBlending() && blendInClip.SupportsBlending())
     {
         double num = Math.Max(0.0, blendOutClip.start + blendOutClip.duration - blendInClip.start);
         num = ((num > TrackExtensions.kMinOverlapTime) ? num : 0.0);
         blendOutClip.blendOutDuration = num;
         blendInClip.blendInDuration   = num;
         TimelineClip.BlendCurveMode blendInCurveMode  = blendInClip.blendInCurveMode;
         TimelineClip.BlendCurveMode blendOutCurveMode = blendOutClip.blendOutCurveMode;
         if (blendInCurveMode == TimelineClip.BlendCurveMode.Manual && blendOutCurveMode == TimelineClip.BlendCurveMode.Auto)
         {
             blendOutClip.mixOutCurve = CurveEditUtility.CreateMatchingCurve(blendInClip.mixInCurve);
         }
         else if (blendInCurveMode == TimelineClip.BlendCurveMode.Auto && blendOutCurveMode == TimelineClip.BlendCurveMode.Manual)
         {
             blendInClip.mixInCurve = CurveEditUtility.CreateMatchingCurve(blendOutClip.mixOutCurve);
         }
         else if (blendInCurveMode == TimelineClip.BlendCurveMode.Auto && blendOutCurveMode == TimelineClip.BlendCurveMode.Auto)
         {
             blendInClip.mixInCurve   = null;
             blendOutClip.mixOutCurve = null;
         }
     }
 }