Esempio n. 1
0
 public void SelectPreviousTackOfTimelines(string currentActiveObjectId)
 {
     /*
      *      if current active id is tack, select previous one.
      *      and if active tack is the head of timeline, select timeline itself.
      */
     if (TimeFlowShikiGUIWindow.IsTackId(currentActiveObjectId))
     {
         foreach (var timelineTrack in timelineTracks)
         {
             timelineTrack.SelectPreviousTackOf(currentActiveObjectId);
         }
     }
 }
Esempio n. 2
0
 public void DeleteObjectById(string deletedObjectId)
 {
     foreach (var timelineTrack in timelineTracks)
     {
         if (TimeFlowShikiGUIWindow.IsTimelineId(deletedObjectId))
         {
             if (timelineTrack.timelineId == deletedObjectId)
             {
                 timelineTrack.Deleted();
             }
         }
         if (TimeFlowShikiGUIWindow.IsTackId(deletedObjectId))
         {
             timelineTrack.DeleteTackById(deletedObjectId);
         }
     }
 }
Esempio n. 3
0
        public void SelectAboveObjectById(string currentActiveObjectId)
        {
            if (TimeFlowShikiGUIWindow.IsTimelineId(currentActiveObjectId))
            {
                var candidateTimelines   = timelineTracks.Where(timeline => timeline.IsExistTimeline).OrderBy(timeline => timeline.GetIndex()).ToList();
                var currentTimelineIndex = candidateTimelines.FindIndex(timeline => timeline.timelineId == currentActiveObjectId);

                if (0 < currentTimelineIndex)
                {
                    var targetTimeline = timelineTracks[currentTimelineIndex - 1];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId));
                    return;
                }

                return;
            }

            if (TimeFlowShikiGUIWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start;
                var currentTimelineId      = currentActiveTack.parentTimelineId;

                var aboveTimeline = AboveTimeline(currentTimelineId);
                if (aboveTimeline != null)
                {
                    var nextActiveTacks = aboveTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, aboveTimeline.timelineId));
                    }
                }
                return;
            }
        }
Esempio n. 4
0
        public void SelectBelowObjectById(string currentActiveObjectId)
        {
            if (TimeFlowShikiGUIWindow.IsTimelineId(currentActiveObjectId))
            {
                var cursoredTimelineIndex = timelineTracks.FindIndex(timeline => timeline.timelineId == currentActiveObjectId);
                if (cursoredTimelineIndex < timelineTracks.Count - 1)
                {
                    var targetTimelineIndex = cursoredTimelineIndex + 1;
                    var targetTimeline      = timelineTracks[targetTimelineIndex];
                    Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTimeline.timelineId));
                }
                return;
            }

            if (TimeFlowShikiGUIWindow.IsTackId(currentActiveObjectId))
            {
                /*
                 *      select another timeline's same position tack.
                 */
                var currentActiveTack = TackById(currentActiveObjectId);

                var currentActiveTackStart = currentActiveTack.start;
                var currentTimelineId      = currentActiveTack.parentTimelineId;

                var belowTimeline = BelowTimeline(currentTimelineId);
                if (belowTimeline != null)
                {
                    var nextActiveTacks = belowTimeline.TacksByStart(currentActiveTackStart);
                    if (nextActiveTacks.Any())
                    {
                        var targetTack = nextActiveTacks[0];
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, targetTack.tackId));
                    }
                    else
                    {
                        // no tack found, select timeline itself.
                        Emit(new OnTrackEvent(OnTrackEvent.EventType.EVENT_OBJECT_SELECTED, belowTimeline.timelineId));
                    }
                }
                return;
            }
        }
Esempio n. 5
0
        public int GetStartFrameById(string objectId)
        {
            if (TimeFlowShikiGUIWindow.IsTimelineId(objectId))
            {
                return(-1);
            }

            if (TimeFlowShikiGUIWindow.IsTackId(objectId))
            {
                var targetContainedTimelineIndex = GetTackContainedTimelineIndex(objectId);
                if (0 <= targetContainedTimelineIndex)
                {
                    var foundStartFrame = timelineTracks[targetContainedTimelineIndex].GetStartFrameById(objectId);
                    if (0 <= foundStartFrame)
                    {
                        return(foundStartFrame);
                    }
                }
            }

            return(-1);
        }
Esempio n. 6
0
        public void SelectNextTackOfTimelines(string currentActiveObjectId)
        {
            // if current active id is timeline, select first tack of that.
            if (TimeFlowShikiGUIWindow.IsTimelineId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks)
                {
                    if (timelineTrack.timelineId == currentActiveObjectId)
                    {
                        timelineTrack.SelectDefaultTackOrSelectTimeline();
                    }
                }
                return;
            }

            // if current active id is tack, select next one.
            if (TimeFlowShikiGUIWindow.IsTackId(currentActiveObjectId))
            {
                foreach (var timelineTrack in timelineTracks)
                {
                    timelineTrack.SelectNextTackOf(currentActiveObjectId);
                }
            }
        }