Ejemplo n.º 1
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);
            }
        }
Ejemplo n.º 2
0
        public void DrawProjectVideoTimeline(
            Graphics g,
            int Width,
            int Height,
            VidkaProj proj,
            VidkaFileMapping projMapping,
            ProjectDimensions dimdim,
            VidkaClipVideo currentVideoClip,
            EditorDraggy draggy)
        {
            // draw video events
            long curFrame = 0;

            int y1     = dimdim.getY_main1(Height);
            int y2     = dimdim.getY_main2(Height);
            int yaudio = dimdim.getY_main_half(Height);
            int cliph  = y2 - y1;            // clip height (video and audio)
            int clipvh = yaudio - y1;        // clip (only video) height (just the video part, no audio!)
            int index  = 0;
            int draggyVideoShoveIndex = dimdim.GetVideoClipDraggyShoveIndex(draggy);

            foreach (var vclip in proj.ClipsVideo)
            {
                if (dimdim.isEvenOnTheScreen(curFrame, curFrame + vclip.LengthFrameCalc, Width))
                {
                    if (draggy.Mode == EditorDraggyMode.VideoTimeline && draggyVideoShoveIndex == index)
                    {
                        drawDraggyVideo(g, curFrame, y1, cliph, clipvh, draggy, dimdim);
                        curFrame += draggy.FrameLength;
                    }

                    if (draggy.VideoClip != vclip)
                    {
                        var brush = brushWhite;
                        if (vclip == currentVideoClip && vclip.IsLocked)
                        {
                            brush = brushLockedActiveClip;
                        }
                        else if (vclip == currentVideoClip)
                        {
                            brush = brushActive;
                        }
                        else if (vclip.IsLocked)
                        {
                            brush = brushLockedClip;
                        }
                        drawVideoClip(g, vclip,
                                      curFrame, y1, cliph, clipvh,
                                      brush,
                                      proj, projMapping, dimdim
                                      );
                    }
                }

                index++;
                if (draggy.VideoClip != vclip)
                {
                    curFrame += vclip.LengthFrameCalc;
                }
            }

            if (draggy.Mode == EditorDraggyMode.VideoTimeline && draggyVideoShoveIndex == index)
            {
                drawDraggyVideo(g, curFrame, y1, cliph, clipvh, draggy, dimdim);
            }
        }