public void NewFilesDragged(string[] filenames, long nFakeFrames)
        {
            var relevantFiles = GetRelevantFilenames(filenames);
            var sampleFirst   = relevantFiles.FirstOrDefault();

            if (IsFilenameVideo(sampleFirst))
            {
                Mode = DragAndDropManagerMode.DraggingVideo;
                foreach (var filename in relevantFiles)
                {
                    _draggies.Add(new DragAndDropMediaFile(Proj)
                    {
                        Filename    = filename,
                        NFakeFrames = nFakeFrames,
                        Mode        = Mode,
                    });
                    metaGenerator.RequestMeta(filename);
                    metaGenerator.RequestThumbsAndWave(filename);
                }
            }
            else if (IsFilenameAudio(sampleFirst))
            {
                Mode = DragAndDropManagerMode.DraggingAudio;
                // TODO: Q audio...
            }
            else
            {
            }
            // TODO: the mapped filenames (xml, thumbs, etc) should be done inside metaGenerator
            //var filenameXml = metaGenerator. Proj.Mapping.AddGetMetaFilename(filename);
            // runs the XML generations
            //new Ops.MetadataExtraction(filename, filenameXml);
        }
Exemplo n.º 2
0
        public void NewFilesDragged(string[] filenames, long nFakeFrames)
        {
            draggedRelevantFiles = GetRelevantFilenames(filenames);
            var sampleFirst = draggedRelevantFiles.FirstOrDefault();

            OriginalFiles = draggedRelevantFiles;
            OriginalFile  = sampleFirst;
            if (IsFilenameVideo(sampleFirst))
            {
                Mode       = DragAndDropManagerMode.Video;
                DraggyText = GetDraggyTextAnalyzing(draggedRelevantFiles);
                foreach (var filename in draggedRelevantFiles)
                {
                    _draggies.Add(new DragAndDropMediaFile(Proj)
                    {
                        Filename    = filename,
                        NFakeFrames = nFakeFrames,
                    });
                    metaGenerator.RequestMeta(filename);
                    metaGenerator.RequestThumbsAndWave(filename);
                }
            }
            else if (IsFilenameAudio(sampleFirst))
            {
                Mode       = DragAndDropManagerMode.Audio;
                DraggyText = GetDraggyTextAnalyzing(draggedRelevantFiles);
                foreach (var filename in draggedRelevantFiles)
                {
                    _draggies.Add(new DragAndDropMediaFile(Proj)
                    {
                        Filename    = filename,
                        NFakeFrames = (long)(Proj.FrameRate * Settings.Default.ImageClipLengthSeconds),
                        HasAudio    = true,
                    });
                    metaGenerator.RequestMeta(filename);
                    metaGenerator.RequestWaveOnly(filename);
                }
            }
            else if (IsFilenameImage(sampleFirst))
            {
                Mode       = DragAndDropManagerMode.Image;
                DraggyText = GetDraggyTextAnalyzing(draggedRelevantFiles);
                foreach (var filename in draggedRelevantFiles)
                {
                    _draggies.Add(new DragAndDropMediaFile(Proj)
                    {
                        Filename    = filename,
                        NFakeFrames = (long)(Proj.FrameRate * Settings.Default.ImageClipLengthSeconds),
                        HasAudio    = false,
                    });
                    //metaGenerator.RequestMeta(filename);
                    metaGenerator.RequestThumbsOnly(filename);
                }
            }
            else if (Directory.Exists(sampleFirst))
            {
                Mode       = DragAndDropManagerMode.Folder;
                DraggyText = Path.GetFileName(sampleFirst);
                _draggies.Add(new DragAndDropMediaFile(Proj)
                {
                    Filename = sampleFirst,
                });
            }
            else if (IsFilenameVidkaProject(sampleFirst))
            {
                Mode       = DragAndDropManagerMode.VidkaProject;
                DraggyText = Path.GetFileName(sampleFirst);
                _draggies.Add(new DragAndDropMediaFile(Proj)
                {
                    Filename = sampleFirst,
                });
            }
            foreach (var ddd in _draggies)
            {
                ddd.Mode = Mode;
            }
        }