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();
}
}