public VidkaClipAudio[] FinalizeDragAndMakeAudioClips(long firstFrameFromDraggy) { if (Mode != DragAndDropManagerMode.Audio) { return(null); } lock (this) { //TODO: Take(1) is to be removed when we support multiple draggies var clips = _draggies.Select(x => new VidkaClipAudio { Id = VidkaIO.MakeGuidWord(), FileName = x.Filename, FileLengthSec = Proj.FrameToSec(x.LengthInFrames), FrameStart = 0, FrameEnd = x.LengthInFrames, //Proj.SecToFrame(dragMeta.VideoDurationSec) // its ok because SecToFrame floors it IsNotYetAnalyzed = (x.Meta == null), }).ToList(); var curFrame = firstFrameFromDraggy; foreach (var clip in clips) { clip.FrameOffset = curFrame; curFrame += clip.LengthFrameCalc; } outstandingAudio.AddRange(clips.Where(x => x.IsNotYetAnalyzed)); FinalizeThisDragDropOp(); return(clips.ToArray()); } }
public VidkaClipAudio[] FinalizeDragAndMakeAudioClips() { if (Mode != DragAndDropManagerMode.DraggingAudio) { return(null); } lock (this) { //TODO: Take(1) is to be removed when we support multiple draggies var clips = _draggies.Take(1).Select(x => new VidkaClipAudio { FileName = x.Filename, FileLengthSec = Proj.FrameToSec(x.LengthInFrames), FrameStart = 0, FrameEnd = x.LengthInFrames, //Proj.SecToFrame(dragMeta.VideoDurationSec) // its ok because SecToFrame floors it IsNotYetAnalyzed = (x.Meta == null) }).ToList(); outstandingAudio.AddRange(clips.Where(x => x.IsNotYetAnalyzed)); _draggies.Clear(); Mode = DragAndDropManagerMode.None; throw new NotImplementedException(); return(clips.ToArray()); } }
public VidkaClipVideoAbstract[] FinalizeDragAndMakeVideoClips() { lock (this) { IEnumerable <VidkaClipVideoAbstract> clips = null; if (Mode == DragAndDropManagerMode.Video) { //TODO: asdqdscqwwq Take(1) is to be removed when we support multiple draggies clips = _draggies.Select(x => new VidkaClipVideo { FileName = x.Filename, FileLengthSec = Proj.FrameToSec(x.LengthInFrames), FrameStart = 0, FrameEnd = x.LengthInFrames, //Proj.SecToFrame(dragMeta.VideoDurationSec) // its ok because SecToFrame floors it IsNotYetAnalyzed = (x.Meta == null), HasAudioXml = (x.Meta != null) ? x.Meta.HasAudio : false, }).ToList(); outstandingVideo.AddRange(clips.Where(x => x.IsNotYetAnalyzed)); } else if (Mode == DragAndDropManagerMode.Image) { clips = _draggies.Select(x => new VidkaClipImage { FileName = x.Filename, FileLengthSec = Proj.FrameToSec(x.LengthInFrames), //HasAudioXml = false, FrameStart = 0, FrameEnd = x.LengthInFrames, IsNotYetAnalyzed = false }).ToList(); } FinalizeThisDragDropOp(); return((clips == null) ? null : clips.ToArray()); } }