public void DrawGUI(WindowState state, Rect bounds, Color color, TrimEdge edge)
        {
            if (EditModeUtils.HasBlends(m_Item, edge))
            {
                EditModeGUIUtils.DrawBoundsEdge(bounds, color, edge);
                var cursorType = (edge == TrimEdge.End)
                    ? TimelineCursors.CursorType.MixRight
                    : TimelineCursors.CursorType.MixLeft;

                TimelineCursors.SetCursor(cursorType);
            }
            else
            {
                TimelineCursors.ClearCursor();
            }
        }
Example #2
0
        public void DrawGUI(WindowState state, IEnumerable <MovingItems> movingItems, Color color)
        {
            var selectionHasAnyBlendIn  = false;
            var selectionHasAnyBlendOut = false;

            foreach (var grabbedItems in movingItems)
            {
                var bounds = grabbedItems.onTrackItemsBounds;

                var counter = 0;
                foreach (var item in grabbedItems.items.OfType <IBlendable>())
                {
                    if (item.hasLeftBlend)
                    {
                        EditModeGUIUtils.DrawBoundsEdge(bounds[counter], color, TrimEdge.Start);
                        selectionHasAnyBlendIn = true;
                    }

                    if (item.hasRightBlend)
                    {
                        EditModeGUIUtils.DrawBoundsEdge(bounds[counter], color, TrimEdge.End);
                        selectionHasAnyBlendOut = true;
                    }
                    counter++;
                }
            }

            if (selectionHasAnyBlendIn && selectionHasAnyBlendOut)
            {
                TimelineCursors.SetCursor(TimelineCursors.CursorType.MixBoth);
            }
            else if (selectionHasAnyBlendIn)
            {
                TimelineCursors.SetCursor(TimelineCursors.CursorType.MixLeft);
            }
            else if (selectionHasAnyBlendOut)
            {
                TimelineCursors.SetCursor(TimelineCursors.CursorType.MixRight);
            }
            else
            {
                TimelineCursors.ClearCursor();
            }
        }
        public void DrawGUI(WindowState state, IEnumerable <MovingItems> movingItems, Color color)
        {
            var operationWillReplace = false;

            foreach (var itemsPerTrack in movingItems)
            {
                var bounds = itemsPerTrack.onTrackItemsBounds;

                var counter = 0;
                foreach (var item in itemsPerTrack.items)
                {
                    if (EditModeUtils.GetFirstIntersectedItem(itemsPerTrack.items, item.start) != null)
                    {
                        EditModeGUIUtils.DrawBoundsEdge(bounds[counter], color, TrimEdge.Start);
                        operationWillReplace = true;
                    }

                    if (EditModeUtils.GetFirstIntersectedItem(itemsPerTrack.items, item.end) != null)
                    {
                        EditModeGUIUtils.DrawBoundsEdge(bounds[counter], color, TrimEdge.End);
                        operationWillReplace = true;
                    }

                    counter++;
                    // TODO Display swallowed clips?
                }
            }

            if (operationWillReplace)
            {
                TimelineCursors.SetCursor(TimelineCursors.CursorType.Replace);
            }
            else
            {
                TimelineCursors.ClearCursor();
            }
        }
        public void DrawGUI(WindowState state, IEnumerable <MovingItems> movingItems, Color color)
        {
            if (m_Detached)
            {
                var xMin = float.MaxValue;
                var xMax = float.MinValue;

                foreach (var grabbedItems in movingItems)
                {
                    xMin = Math.Min(xMin, grabbedItems.onTrackItemsBounds.Min(b => b.xMin)); // TODO Cache this?
                    xMax = Math.Max(xMax, grabbedItems.onTrackItemsBounds.Max(b => b.xMax));
                }

                foreach (var grabbedItems in movingItems)
                {
                    var bounds = Rect.MinMaxRect(xMin, grabbedItems.onTrackItemsBounds[0].yMin,
                                                 xMax, grabbedItems.onTrackItemsBounds[0].yMax);

                    EditModeGUIUtils.DrawOverlayRect(bounds, new Color(1.0f, 1.0f, 1.0f, 0.5f));

                    EditModeGUIUtils.DrawBoundsEdge(bounds, color, TrimEdge.Start);
                }
            }
            else
            {
                foreach (var grabbedItems in movingItems)
                {
                    var bounds = Rect.MinMaxRect(grabbedItems.onTrackItemsBounds.Min(b => b.xMin), grabbedItems.onTrackItemsBounds[0].yMin,
                                                 grabbedItems.onTrackItemsBounds.Max(b => b.xMax), grabbedItems.onTrackItemsBounds[0].yMax);

                    EditModeGUIUtils.DrawBoundsEdge(bounds, color, TrimEdge.Start);
                }
            }

            TimelineCursors.SetCursor(TimelineCursors.CursorType.Ripple);
        }
        public void DrawGUI(WindowState state, Rect bounds, Color color, TrimEdge edge)
        {
            bool shouldDraw = m_ItemToBeReplaced != null && (edge == TrimEdge.End && m_Item.end > m_ClipOriginalEdgeValue) ||
                              (edge == TrimEdge.Start && m_Item.start < m_ClipOriginalEdgeValue);

            if (shouldDraw)
            {
                var cursorType = TimelineCursors.CursorType.Replace;
                if (EditModeUtils.HasBlends(m_Item, edge))
                {
                    color      = DirectorStyles.kMixToolColor;
                    cursorType = (edge == TrimEdge.End)
                        ? TimelineCursors.CursorType.MixRight
                        : TimelineCursors.CursorType.MixLeft;
                }

                EditModeGUIUtils.DrawBoundsEdge(bounds, color, edge);
                TimelineCursors.SetCursor(cursorType);
            }
            else
            {
                TimelineCursors.ClearCursor();
            }
        }
Example #6
0
 public void DrawGUI(WindowState state, Rect bounds, Color color, TrimEdge edge)
 {
     EditModeGUIUtils.DrawBoundsEdge(bounds, color, edge);
     TimelineCursors.SetCursor(TimelineCursors.CursorType.Ripple);
 }