Exemple #1
0
        public void OutlineClipVideoHover(
            Graphics g,
            VidkaClipVideo vclip,
            ProjectDimensions dimdim,
            int Height,
            TrimDirection trimDirection,
            int trimBracketLength,
            long framesActiveMouseTrim)
        {
            int y1 = dimdim.getY_main1(Height);
            int y2 = dimdim.getY_main2(Height);
            //int yaudio = dimdim.getY_main_half(Height);
            int x1    = dimdim.getScreenX1(vclip);
            int clipW = dimdim.convert_FrameToAbsX(vclip.LengthFrameCalc);             // hacky, I know

            g.DrawRectangle(penHover, x1, y1, clipW, y2 - y1);
            if (trimDirection == TrimDirection.Left)
            {
                drawTrimBracket(g, x1, y1, y2, TrimDirection.Left, trimBracketLength, dimdim.convert_FrameToAbsX(framesActiveMouseTrim), dimdim);
            }
            if (trimDirection == TrimDirection.Right)
            {
                drawTrimBracket(g, x1 + clipW, y1, y2, TrimDirection.Right, trimBracketLength, dimdim.convert_FrameToAbsX(framesActiveMouseTrim), dimdim);
            }
        }
Exemple #2
0
        public void DrawProjectAudioTimeline(
            Graphics g,
            int Width,
            int Height,
            VidkaProj proj,
            ProjectDimensions dimdim,
            VidkaClipAudio currentAudioClip,
            EditorDraggy draggy)
        {
            // draw video events
            long curFrame = 0;

            int y1    = dimdim.getY_audio1(Height);
            int y2    = dimdim.getY_audio2(Height);
            int cliph = y2 - y1;

            foreach (var aclip in proj.ClipsAudio)
            {
                if (dimdim.isEvenOnTheScreen(curFrame, curFrame + aclip.LengthFrameCalc, Width))
                {
                    int x1    = dimdim.convert_Frame2ScreenX(curFrame);
                    int x2    = dimdim.convert_Frame2ScreenX(curFrame + aclip.LengthFrameCalc);
                    int clipw = x2 - x1;

                    // active video clip deserves a special outline
                    //if (aclip == currentAudioClip)
                    //	g.FillRectangle(brushActive, x1, y1, clipw, clipvh);
                    //else
                    //	g.FillRectangle(brushWhite, x1, y1, clipw, clipvh);

                    throw new NotImplementedException("DrawWaveform that takes Audio clip!!!");
                    //DrawWaveform(g, proj, aclip, x1, y1, clipw, cliph,
                    //	proj.FrameToSec(aclip.FrameStart), proj.FrameToSec(aclip.FrameEnd));


                    // outline rect
                    g.DrawRectangle(penDefault, x1, y1, clipw, cliph);
                }

                curFrame += aclip.LengthFrameCalc;
            }
            if (draggy.Mode == EditorDraggyMode.AudioTimeline)
            {
                var draggyX = draggy.MouseX - draggy.MouseXOffset;
                var draggyW = dimdim.convert_FrameToAbsX(draggy.FrameLength);                 // hacky, i know
                g.DrawRectangle(penBorderDrag, draggyX, y1, draggyW, cliph);
            }
        }
Exemple #3
0
        private void drawDraggyVideo(Graphics g, long curFrame, int y1, int cliph, int clipvh, EditorDraggy draggy, ProjectDimensions dimdim)
        {
            var draggyX = dimdim.convert_Frame2ScreenX(curFrame);
            var draggyW = dimdim.convert_FrameToAbsX(draggy.FrameLength);             // hacky, i know

            if (draggy.VideoClip != null)
            {
                g.FillRectangle(brushWhite, draggyX, y1, draggyW, cliph);
                g.FillRectangle(brushActive, draggyX, y1, draggyW, clipvh);
            }
            g.DrawRectangle(penBorderDrag, draggyX, y1, draggyW, cliph);
            g.DrawString(draggy.Text, fontDefault, brushDefault, draggyX + 5, y1 + 5);

            // debug rect
            //g.DrawRectangle(penDefault, draggy.MouseX-draggy.MouseXOffset, y1-2, draggyW, cliph+5);
        }
Exemple #4
0
        internal void DrawCurrentClipVideo(
            Graphics g,
            VidkaClipVideo vclip,
            ProjectDimensions dimdim,
            VidkaProj proj,
            VidkaFileMapping projMapping,
            int w, int h,
            OutlineClipType type,
            bool isOriginalPlaybackMode,
            TrimDirection trimDirection,
            int trimBracketLength,
            long markerFrame,
            long selectedClipFrameOffset,
            long framesActiveMouseTrim)
        {
            int yMainTop   = dimdim.getY_main1(h);
            int xMain1     = dimdim.getScreenX1(vclip);
            int xMain2     = xMain1 + dimdim.convert_FrameToAbsX(vclip.LengthFrameCalc);    //hacky, I know
            int xMainDelta = dimdim.convert_FrameToAbsX(framesActiveMouseTrim);             //hacky, I know
            int xOrig1     = dimdim.convert_Frame2ScreenX_OriginalTimeline(vclip.FrameStart, vclip.FileLengthFrames, w);
            int xOrig2     = dimdim.convert_Frame2ScreenX_OriginalTimeline(vclip.FrameEnd, vclip.FileLengthFrames, w);
            int xOrigDelta = dimdim.convert_Frame2ScreenX_OriginalTimeline(framesActiveMouseTrim, vclip.FileLengthFrames, w);             // hacky, I know
            int y1         = dimdim.getY_original1(h);
            int y2         = dimdim.getY_original2(h);
            int yaudio     = dimdim.getY_original_half(h);

            // draw entire original clip (0 .. vclip.FileLength)
            g.FillRectangle(brushWhite, 0, y1, w, y2 - y1);
            g.FillRectangle(brushActive, xOrig1, y1, xOrig2 - xOrig1, y2 - y1);
            DrawClipBitmaps(g, proj, projMapping, vclip, 0, y1, w, yaudio - y1, 0, vclip.FileLengthSec ?? 0);
            DrawWaveform(g, proj, projMapping, vclip, 0, yaudio, w, y2 - yaudio, 0, vclip.FileLengthSec ?? 0);
            if (vclip.IsMuted)
            {
                g.FillRectangle(brushHazyMute, xOrig1, yaudio, xOrig2 - xOrig1, y2 - yaudio);
            }
            g.DrawLine(penGray, 0, yaudio, w, yaudio);
            g.DrawRectangle(penDefault, 0, y1, w, y2 - y1);

            //draw clip bounds
            g.DrawLine((type == OutlineClipType.Hover) ? penHover : penGray, xMain1, yMainTop, xOrig1, y2);
            g.DrawLine((type == OutlineClipType.Hover) ? penHover : penGray, xMain2, yMainTop, xOrig2, y2);
            g.DrawLine((type == OutlineClipType.Hover) ? penHover : penGray, xOrig1, y1, xOrig1, y2);
            g.DrawLine((type == OutlineClipType.Hover) ? penHover : penGray, xOrig2, y1, xOrig2, y2);
            if (type == OutlineClipType.Hover)
            {
                if (trimDirection == TrimDirection.Left)
                {
                    g.DrawLine(penActiveBoundary, xMain1 + xMainDelta, yMainTop, xOrig1 + xOrigDelta, y2);
                    drawTrimBracket(g, xOrig1, y1, y2, TrimDirection.Left, trimBracketLength, xOrigDelta, dimdim);
                }
                if (trimDirection == TrimDirection.Right)
                {
                    g.DrawLine(penActiveBoundary, xMain2 + xMainDelta, yMainTop, xOrig2 + xOrigDelta, y2);
                    drawTrimBracket(g, xOrig2, y1, y2, TrimDirection.Right, trimBracketLength, xOrigDelta, dimdim);
                }
            }

            // draw marker on
            var frameOffset = isOriginalPlaybackMode
                                ? markerFrame
                                : markerFrame - selectedClipFrameOffset + vclip.FrameStart;
            int xMarker = dimdim.convert_Frame2ScreenX_OriginalTimeline(frameOffset, vclip.FileLengthFrames, w);

            g.DrawLine(penMarker, xMarker, y1, xMarker, y2);
        }