Пример #1
0
        public void TrimStart(ITrimmable item, double time, bool affectTimeScale)
        {
            var prevEnd = item.end;

            // HACK If time is negative, make sure we shift the SetStart operation to a positive space.
            if (time < 0.0)
            {
                m_TrimStartShift = Math.Max(-time, m_TrimStartShift);
            }

            item.start = m_OriginalClipEnd - item.duration + m_TrimStartShift;
            time      += m_TrimStartShift;

            if (m_BlendDuration > 0.0)
            {
                time = Math.Min(time, item.end - m_BlendDuration);
            }

            item.SetStart(time, affectTimeScale);

            item.start = m_OriginalClipStart;

            var offset = item.end - prevEnd;

            foreach (var timelineClip in m_NextItems)
            {
                timelineClip.start += offset;
            }
        }
        public void TrimEnd(ITrimmable item, double time, bool affectTimeScale)
        {
            time = Math.Min(Math.Max(time, m_Min), m_Max);

            if (m_ItemToBeReplaced != null)
            {
                if (!m_TrimReplace)
                {
                    m_TrimReplace = item.end <= m_ItemToBeReplaced.start;
                }
            }

            item.SetEnd(time, affectTimeScale);

            if (m_ItemToBeReplaced != null && m_TrimReplace)
            {
                var nextStart = Math.Max(item.end, m_ClipOriginalEdgeValue);
                m_ItemToBeReplaced.SetStart(nextStart);
            }
        }
        public void TrimStart(ITrimmable item, double time)
        {
            time = Math.Min(Math.Max(time, m_Min), m_Max);

            if (m_ItemToBeReplaced != null)
            {
                if (!m_TrimReplace)
                {
                    m_TrimReplace = item.start >= m_ItemToBeReplaced.end;
                }
            }

            time = Math.Max(time, 0.0);

            item.SetStart(time);

            if (m_ItemToBeReplaced != null && m_TrimReplace)
            {
                var prevEnd = Math.Min(item.start, m_ClipOriginalEdgeValue);
                m_ItemToBeReplaced.SetEnd(prevEnd, false);
            }
        }
 public void TrimStart(ITrimmable item, double time)
 {
     time = Math.Min(Math.Max(time, m_Min), m_Max);
     item.SetStart(time);
 }
 public void TrimStart(ITrimmable item, double time, bool affectTimeScale)
 {
     time = Math.Min(Math.Max(time, m_Min), m_Max);
     item.SetStart(time, affectTimeScale);
 }