Ejemplo n.º 1
0
        public void PrepareCanvas(Graphics g, ProjectDimensions dimdim, int w, int h, ProjectDimensionsTimelineType hover)
        {
            int yMain1    = dimdim.getY_main1(h);
            int yMain2    = dimdim.getY_main2(h);
            int yMainHalf = dimdim.getY_main_half(h);
            int yAudio1   = dimdim.getY_audio1(h);
            int yAudio2   = dimdim.getY_audio2(h);

            g.FillRectangle((hover == ProjectDimensionsTimelineType.Main) ? brushLightGray2 : brushLightGray, 0, yMain1, w, yMainHalf - yMain1);
            g.FillRectangle((hover == ProjectDimensionsTimelineType.Main) ? brushLightGray3 : brushLightGray2, 0, yMainHalf, w, yMain2 - yMainHalf);
            g.FillRectangle((hover == ProjectDimensionsTimelineType.Audios) ? brushLightGray3 : brushLightGray2, 0, yAudio1, w, yAudio2 - yAudio1);
        }
Ejemplo n.º 2
0
        public void OutlineClipAudioHover(Graphics g, VidkaClipAudio aclip, ProjectDimensions dimdim, int Height)
        {
            throw new NotImplementedException();
            // TODO: this was never used...
            // TODO: write a generic function to handle both outline of video and audio clips
            int y1 = dimdim.getY_audio1(Height);
            int y2 = dimdim.getY_audio2(Height);
            //var secStart = dimdim.FrameToSec(aclip.FrameStart);
            //var secEnd = dimdim.FrameToSec(aclip.FrameEnd);
            int x1 = dimdim.convert_Frame2ScreenX(aclip.FrameStart);
            int x2 = dimdim.convert_Frame2ScreenX(aclip.FrameEnd);

            g.DrawRectangle(penHover, x1, y1, x2 - x1, y2 - y1);
            // TODO: audio clip trim direction not implemented!!!
        }
Ejemplo n.º 3
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);
            }
        }