예제 #1
0
 public void SetDraggyAudio(VidkaClipAudio clip)
 {
     if (Draggy.AudioClip != clip)
     {
         stateChanged = true;
     }
     Draggy.AudioClip = clip;
 }
예제 #2
0
 internal void Clear()
 {
     Mode         = EditorDraggyMode.None;
     Text         = null;
     FrameLength  = 0;
     MouseX       = 0;
     MouseXOffset = 0;
     VideoClip    = null;
     AudioClip    = null;
 }
예제 #3
0
 /// <summary>
 /// There can only be one hover b/w video and audio line, so video will be set to null
 /// </summary>
 public void SetHoverAudio(VidkaClipAudio hover)
 {
     if (CurrentAudioClipHover != hover ||
         CurrentVideoClipHover != null)
     {
         stateChanged = true;
     }
     CurrentAudioClipHover = hover;
     CurrentVideoClipHover = null;
 }
예제 #4
0
 /// <summary>
 /// There can only be one selected (active) b/w video and audio line, so video will be set to null
 /// </summary>
 public void SetActiveAudio(VidkaClipAudio active)
 {
     if (CurrentAudioClip != active ||
         CurrentVideoClip != null)
     {
         stateChanged = true;
         originalTimelineSelectionChanged = true;
         SetOriginalTimelinePlaybackMode(false);
     }
     CurrentAudioClip       = active;
     CurrentVideoClip       = null;
     CurrentClipFrameAbsPos = (active != null) ? (long?)active.FrameStart : null;
 }
예제 #5
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!!!
        }
예제 #6
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);
            }
        }
예제 #7
0
 /// <summary>
 /// There can only be one selected (active) b/w video and audio line, so video will be set to null
 /// </summary>
 public void SetActiveAudio(VidkaClipAudio active)
 {
     if (CurrentAudioClip != active ||
         CurrentVideoClip != null)
     {
         stateChanged = true;
         originalTimelineSelectionChanged = true;
         SetOriginalTimelinePlaybackMode(false);
     }
     CurrentAudioClip = ArrayOfOne_ClipsAudio[0] = active;
     CurrentVideoClip = null;
     resetCurrentClipUsages();
     if (active != null)
     {
         CurClipAllUsagesAudio = ArrayOfOne_ClipsAudio;
     }
     UpdateCurrentClipFrameAbsPos(null);
 }
예제 #8
0
        public VidkaClipAudio collision_audio(int x)
        {
            lastCollision_succeeded = false;
            lastCollision_easeSide  = TrimDirection.None;
            VidkaClipAudio lastAudioClipCollision = null;

            foreach (var ccc in proj.ClipsAudio)
            {
                if (calculateCollision_proj(x, ccc.FrameOffset, ccc.LengthFrameCalc))
                {
                    lastAudioClipCollision = ccc;
                }
            }
            if (lastCollision_succeeded = (lastAudioClipCollision != null))
            {
                calculateCollision_proj(x, lastAudioClipCollision.FrameOffset, lastAudioClipCollision.LengthFrameCalc);
            }
            return(lastAudioClipCollision);
        }
 public void SetParticulars(
     VidkaClipVideoAbstract vclip,
     VidkaFileMapping fileMapping)
 {
     this.imageMan    = new ImageCacheManager();
     this.fileMapping = fileMapping;
     this.vclip       = vclip;
     // set up the vclip that we will draw
     vclipFullToDraw            = vclip.MakeCopy_VideoClip();
     vclipFullToDraw.FrameStart = 0;
     vclipFullToDraw.FrameEnd   = vclipFullToDraw.LengthFrameCalc;
     // set up the audio clip that we will draw
     aclipToDraw = new VidkaClipAudio()
     {
         FileName         = vclip.CustomAudioFilename,
         FileLengthSec    = vclip.CustomAudioLengthSec,
         FileLengthFrames = dimdim.SecToFrame(vclip.CustomAudioLengthSec ?? 0),
         FrameStart       = 0,
         FrameEnd         = dimdim.SecToFrame(vclip.CustomAudioLengthSec ?? 0),
     };
     imageMan.ImagesReady += imageMan_ImagesReady;
 }
        public void SetParticulars(VidkaClipAudio clip)
		{
			VClip = clip;
			// set all the UI
			txtPostOp.Text = VClip.PostOp;
		}
예제 #11
0
        public static void SetFrameMarker_RightOfAClipJustBefore(this IVidkaOpContext iEditor, VidkaClipAudio clip, VidkaProj proj)
        {
            long frameMarker       = clip.FrameOffset; // start
            var  rightThreshFrames = proj.SecToFrame(Settings.Default.RightTrimMarkerOffsetSeconds);

            // if clip is longer than RightTrimMarkerOffsetSeconds, we can skip to end-RightTrimMarkerOffsetSeconds
            if (clip.LengthFrameCalc > rightThreshFrames)
            {
                frameMarker += clip.LengthFrameCalc - rightThreshFrames;
            }
            iEditor.SetFrameMarker_ShowFrameInPlayer(frameMarker);
        }
예제 #12
0
 public static void SetFrameMarker_LeftOfAClip(this IVidkaOpContext iEditor, VidkaClipAudio clip)
 {
     iEditor.SetFrameMarker_ShowFrameInPlayer(clip.FrameOffset);
 }
예제 #13
0
 internal void DrawCurrentClipAudio(Graphics graphics, VidkaClipAudio vidkaAudioClip, int Width, int Height, ProjectDimensions projectDimensions)
 {
     throw new NotImplementedException();
 }