예제 #1
0
 private void SetFilename(string filename)
 {
     if (vclip == null)
     {
         MessageBox.Show("For some strange reason the video clip did not get set to this control...", "Unexpected error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     vclip.CustomAudioFilename = filename;
     vclip.HasCustomAudio      = (filename != null);
     lblAudioProperties.Text   = "Audio info: ...processing, please wait...";
     metaGenerator.RequestMeta(
         filename: filename,
         customCallback: callbackMetaReady);
     metaGenerator.RequestWaveOnly(
         filename: filename,
         customCallback: callbackWaveReady);
     SetFilenameLabel(filename);
     chkHasCustomAudio.Checked = true;
     updateDisabilityOfControlBasedOnCheckbox();
 }
예제 #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;
            }
        }