Example #1
0
        private void MenuItemPreview_Click(object sender, RoutedEventArgs e)
        {
            if (ListBoxJob.SelectedIndex < 0)
            {
                return;
            }

            VideoAnalysis.Preview(ListBoxJob.SelectedItem as EditorInfo);
        }
Example #2
0
        private async void ButtonRun_ClickAsync(object sender, RoutedEventArgs e)
        {
            if (ListBoxJob.Items.Count == 0)
            {
                return;
            }

            // 出力先チェック
            DataContext dc = DataContext as DataContext;

            if (String.IsNullOrEmpty(dc.OutputPath) || !System.IO.Directory.Exists(dc.OutputPath))
            {
                MessageBox.Show("出力先を指定して下さい");
                return;
            }

            // ファイル重複チェック
            HashSet <String> filenames = new HashSet <String>();

            foreach (var item in ListBoxJob.Items)
            {
                String filename = (item as EditorInfo).Filename;
                if (filenames.Contains(filename))
                {
                    MessageBox.Show("ファイル名が重複しています");
                    return;
                }
                filenames.Add(filename);
            }

            // エンコード
            if (dc.Jobs.Info().Mode != Job.eMode.Combination)
            {
                foreach (var item in ListBoxJob.Items)
                {
                    await VideoAnalysis.Encode(dc.OutputPath, item as EditorInfo);
                }
            }

            // 結合
            if (dc.Jobs.Info().Mode != Job.eMode.Encode)
            {
                if (!String.IsNullOrEmpty(dc.CombinationFile))
                {
                    VideoAnalysis.Combination(dc);
                }
            }

            System.Diagnostics.Process.Start(dc.OutputPath);
        }
Example #3
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            String[] files = e.Data.GetData(DataFormats.FileDrop) as String[];
            if (files == null)
            {
                return;
            }

            DataContext dc = DataContext as DataContext;

            foreach (var file in files)
            {
                var info = VideoAnalysis.Analysis(file);
                if (info == null)
                {
                    continue;
                }
                dc.EditorInfos.Add(info);
            }
        }