Beispiel #1
0
 public VidkaUiStateObjects()
 {
     // all the above should be null by default... but what the hell
     TimelineHover         = ProjectDimensionsTimelineType.None;
     CurrentVideoClip      = null;
     CurrentAudioClip      = null;
     CurrentVideoClipHover = null;
     CurrentAudioClipHover = null;
     TrimHover             = TrimDirection.None;
     CurrentMarkerFrame    = 0;
     MouseDragFrameDelta   = 0;
     Draggy = new EditorDraggy();
 }
Beispiel #2
0
        /// <summary>
        /// Converts x-coordinate (on screen!!!) to second
        /// </summary>
        //public double convert_ScreenX2Sec(int x) {
        //	return (x + scrollx) / PIXEL_PER_SEC / zoom;
        //}

        #endregion

        #region ============================== miscellaneous ===========================================

        /// <summary>
        /// Returns index of the clip before which the draggy should be inserted had it been dropped
        /// </summary>
        public int GetVideoClipDraggyShoveIndex(EditorDraggy draggy)
        {
            if (draggy.Mode != EditorDraggyMode.VideoTimeline)
            {
                return(-1);
            }
            //long draggyFrameLeft = convert_ScreenX2Frame(draggy.MouseX - draggy.MouseXOffset);
            long draggyFrameLeft = convert_ScreenX2Frame(draggy.MouseX);
            long totalFrames     = 0;
            int  index           = 0;

            foreach (var clip in proj.ClipsVideo)
            {
                if (totalFrames + clip.LengthFrameCalc / 2 >= draggyFrameLeft)
                {
                    return(index);
                }
                totalFrames += clip.LengthFrameCalc;
                index++;
            }
            return(index);
        }
 /// <summary>
 /// Returns index of the clip before which the draggy should be inserted had it been dropped
 /// </summary>
 public int GetVideoClipDraggyShoveIndex(EditorDraggy draggy)
 {
     if (draggy.Mode != EditorDraggyMode.VideoTimeline)
         return -1;
     //long draggyFrameLeft = convert_ScreenX2Frame(draggy.MouseX - draggy.MouseXOffset);
     long draggyFrameLeft = convert_ScreenX2Frame(draggy.MouseX);
     long totalFrames = 0;
     int index = 0;
     foreach (var clip in proj.ClipsVideo)
     {
         if (totalFrames + clip.LengthFrameCalc / 2 >= draggyFrameLeft)
             return index;
         totalFrames += clip.LengthFrameCalc;
         index++;
     }
     return index;
 }