예제 #1
0
        private void AnalyseFolder(PandaVideoConv conv, string sourceFilePath)
        {
            try
            {
                Mouse.OverrideCursor = Cursors.Wait;

                // make sure its still there

                if (Directory.Exists(sourceFilePath))
                {
                    conv.DiscMode = true;
                    conv.AnalyseFile(sourceFilePath);


                    // Allow convert
                    buttonConvert.IsEnabled = true;
                }
                else
                {
                    logging.Add(new LogItem("Failed to find folder: " + textBoxSourceFilePath.Text));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "PVC failure");
            }
            finally
            {
                Mouse.OverrideCursor = Cursors.Arrow;
            }
        }
예제 #2
0
        private bool AddFilesToList(IEnumerable <string> filelist)
        {
            foreach (var filePath in filelist)
            {
                var convertFile = new PandaVideoConv();
                convertFile.StatusChanged += ConvStatusChanged;
                // set the output prop
                convertFile.OutputFolder   = textBoxOutputFilePath.Text;
                convertFile.SelectedDevice = (IOutputDevice)comboBoxDevice.SelectedValue;

                // Apple ringtone support
                convertFile.RingTone = (bool)checkBoxRingtone.IsChecked;

                // Encode subtitles
                convertFile.EncodeSubtitles = (bool)checkBoxEncodeSubs.IsChecked;
                convertFile.HEVCRecode      = (bool)checkBoxUseHEVC.IsChecked;

                convertFile.PrefferedLanguage = (comboBoxPrefAudioLang.SelectedItem as AudioLanguage).Lang;

                // full analysis
                AnalyseFile(convertFile, filePath);

                // add
                _convList.Add(convertFile);

                listViewConversions.SelectedIndex = listViewConversions.Items.Count - 1;
                Settings.Default.SourceFolder     = filePath;
            }

            Settings.Default.Save();
            return(true);
        }
예제 #3
0
        private void ButtonAddDiscClick(object sender, RoutedEventArgs e)
        {
            var fileDlg = new FolderBrowserDialog
            {
                SelectedPath = Path.GetDirectoryName(Settings.Default.SourceFolder),
                Tag          = "Select a DVD Folder location"
            };

            if (fileDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var convertFile = new PandaVideoConv();
                convertFile.StatusChanged += new ChangedEventHandler(ConvStatusChanged);
                // set the output prop
                convertFile.OutputFolder = textBoxOutputFilePath.Text;

                convertFile.SelectedDevice    = (IOutputDevice)comboBoxDevice.SelectedValue;
                convertFile.PrefferedLanguage = (comboBoxPrefAudioLang.SelectedItem as AudioLanguage).Lang;

                AnalyseFolder(convertFile, fileDlg.SelectedPath);


                _convList.Add(convertFile);

                listViewConversions.SelectedIndex = listViewConversions.Items.Count - 1;
                Settings.Default.SourceFolder     = fileDlg.SelectedPath;
            }
        }
예제 #4
0
        public void TestConvertSample50()
        {
            var convertFile = new PandaVideoConv
            {
                OutputFolder = _outputPath, WorkingFolder = _outputPath, SelectedDevice = new DeviceiPhone3GS()
            };

            Assert.IsTrue(convertFile.AnalyseFile(Path.Combine(_samplesPath, SAMPLE_FILE13))); // \VIDEO_TS

            // Test what we found
            Assert.IsTrue(convertFile.ConvertDisc());
        }
예제 #5
0
 private void ListViewConversionsSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (listViewConversions.SelectedIndex != -1)
     {
         tabItem1.IsEnabled = true;
         _convSelection     = _convList[listViewConversions.SelectedIndex];
         UpdatePanel(_convSelection);
     }
     else
     {
         tabItem1.IsEnabled = false;
     }
 }
예제 #6
0
        public void TestConvertSample4()
        {
            var convertFile = new PandaVideoConv();

            // set the output prop
            convertFile.OutputFolder   = _outputPath;
            convertFile.WorkingFolder  = _outputPath;
            convertFile.SelectedDevice = _device;

            convertFile.AnalyseFile(Path.Combine(_samplesPath, SAMPLE_FILE11));

            // Test what we found
            Assert.IsTrue(convertFile.ConvertFile());
        }
예제 #7
0
        public void TestConvertSample10()
        {
            var convertFile = new PandaVideoConv();

            // set the output prop
            convertFile.OutputFolder   = _outputPath;
            convertFile.WorkingFolder  = _outputPath;
            convertFile.SelectedDevice = (IOutputDevice) new DeviceXBox360();

            Assert.IsTrue(
                convertFile.AnalyseFile(Path.Combine(_samplesPath,
                                                     SAMPLE_FILE8)),
                "Should have been okay");

            // Test what we found
            Assert.IsTrue(convertFile.ConvertFile());
        }
예제 #8
0
        public void TestConvertSubtitlesSample()
        {
            var convertFile = new PandaVideoConv();

            // set the output prop
            convertFile.OutputFolder    = _outputPath;
            convertFile.WorkingFolder   = _outputPath;
            convertFile.SelectedDevice  = _device;
            convertFile.EncodeSubtitles = true;

            Assert.IsTrue(
                convertFile.AnalyseFile(Path.Combine(_samplesPath,
                                                     SAMPLE_FILE14)),
                "Should have been okay");

            // Test what we found
            Assert.IsTrue(convertFile.ConvertFile());
        }
예제 #9
0
        public void TestConvertSample70()
        {
            var convertFile = new PandaVideoConv();

            // set the output prop
            convertFile.OutputFolder   = _outputPath;
            convertFile.WorkingFolder  = _outputPath;
            convertFile.SelectedDevice = _device;

            convertFile.AnalyseFile(Path.Combine(_samplesPath, SAMPLE_FILE12));

            List <AudioTrack> audList = convertFile.GetAudioTracks();

            convertFile.SelectedAudioTrack = audList[0];

            // Test what we found
            Assert.IsTrue(convertFile.ConvertFile());
        }
예제 #10
0
        public void TestInitialAnalysis()
        {
            var samplesPath = Environment.CurrentDirectory + @"\..\..\PandaVideoSamples";
            var outputPath  = Path.Combine(samplesPath, "Output");

            Directory.CreateDirectory(outputPath);

            var convertFile = new PandaVideoConv
            {
                OutputFolder = outputPath, WorkingFolder = outputPath, SelectedDevice = new DevicePS3()
            };

            Assert.IsTrue(convertFile.AnalyseFile(Path.Combine(samplesPath, SAMPLE_FILE1)), "Failed Analysis");

            // Test what we found
            List <VideoTrack> vTracks = convertFile.GetVideoTracks();

            Assert.IsTrue(vTracks.Count > 0);
            VideoTrack vTrack1 = vTracks[0];

            Assert.IsTrue(vTrack1.Width == 1920, "Width is wrong");
            Assert.IsTrue(vTrack1.Height == 800, "Height is wrong");
        }
예제 #11
0
        private void WindowLoaded(object sender, RoutedEventArgs e)
        {
            try
            {
                if (Settings.Default.UpdateRequired)
                {
                    Settings.Default.Upgrade();
                    Settings.Default.UpdateRequired = false;
                }


                // Turn convert off until we have some analysis
                buttonConvert.IsEnabled = false;
                tabItem1.IsEnabled      = false;
                buttonClear.IsEnabled   = false;
                buttonDel.IsEnabled     = false;

                listViewConversions.ItemsSource = _convList;
                listViewLog.ItemsSource         = logging;
                progressBar1.Maximum            = 100;
                progressBar1.Minimum            = 0;

                textBoxOutputFilePath.Text = Settings.Default.OutputFolder;
                textBoxWorkingFolder.Text  = Settings.Default.WorkingFolder;

                if (String.IsNullOrEmpty(textBoxWorkingFolder.Text))
                {
                    textBoxWorkingFolder.Text = Path.GetTempPath();
                }

                // setup output device
                comboBoxDevice.ItemsSource = PandaVideoConv.OutputDeviceList;
                var selected = PandaVideoConv.GetOutputDeviceByName(Settings.Default.OutputDeviceName);
                if (selected != null)
                {
                    comboBoxDevice.SelectedItem = selected;
                }
                else
                {
                    comboBoxDevice.SelectedIndex = 0;
                }

                comboBoxPrefAudioLang.ItemsSource = PandaVideoConv.LanguageList;
                var prefAudioSelected = PandaVideoConv.GetAudioLanguageByDisplayName(Settings.Default.PrefAudioLanguage);
                if (prefAudioSelected != null)
                {
                    comboBoxPrefAudioLang.SelectedItem = prefAudioSelected;
                }
                else
                {
                    comboBoxPrefAudioLang.SelectedIndex = 2; //eng
                }
                checkBoxEncodeSubs.IsChecked      = bool.Parse(Settings.Default.EncodeSubtitles);
                checkBoxAutoCheckUpdate.IsChecked = bool.Parse(Settings.Default.AutoUpdateCheck);
                checkBoxUseHEVC.IsChecked         = bool.Parse(Settings.Default.UseHEVC);

                // Get assembly details to extract built version numbers etc
                Assembly        oAssembly        = Assembly.GetExecutingAssembly();
                FileVersionInfo oFileVersionInfo = FileVersionInfo.GetVersionInfo(oAssembly.Location);
                string          fileVersion      = oFileVersionInfo.FileVersion;
                string          titleversion     = oFileVersionInfo.FileMajorPart + "." + oFileVersionInfo.FileMinorPart;
                // update dlg titles
                labelProductVersion.Content = fileVersion;
                Title = Title + titleversion;

                // Put up some O/S details
                labelOS.Content = String.Format("Running in {0} mode on an {1} O/S", Environment.Is64BitProcess ? "64bit" : "32bit", Environment.Is64BitOperatingSystem ? "64bit" : "32bit");


                // Give user a hint
                logging.Add(new LogItem(DateTime.Now,
                                        "Select required output device and settings then click the batch tab to add files.",
                                        null));
            }
            catch (Exception)
            {
                // Problem with start-up - allow user to recofigure?
            }
        }
예제 #12
0
 private void ButtonClearClick(object sender, RoutedEventArgs e)
 {
     _convList.Clear();
     _convSelection = null;
 }
예제 #13
0
 private void SetSelectedConvItem(PandaVideoConv conv)
 {
     listViewConversions.SelectedItem = conv;
     listViewConversions.ScrollIntoView(conv);
 }
예제 #14
0
        private void UpdatePanel(PandaVideoConv conv)
        {
            textBoxSourceFilePath.Text = conv.SourceVideoFile;


            var vidList = conv.GetVideoTracks();

            if (vidList.Count > 0)
            {
                comboBoxVideoSelection.ItemsSource       = vidList;
                comboBoxVideoSelection.DisplayMemberPath = "UIDescription";
                comboBoxVideoSelection.SelectedItem      = conv.SelectedVideoTrack;
                tabItemVideo.Visibility = Visibility.Visible;
            }
            else
            {
                tabItemVideo.Visibility        = Visibility.Collapsed;
                TabSourceDetails.SelectedIndex = 1;
            }

            // Update panel
            var vt = conv.SelectedVideoTrack;

            if (vt != null)
            {
                labelVBitRate.Content              = String.Format("{0} Kbps", vt.BitRate > 0 ? vt.BitRate.ToString() : "N/A");
                labelRefFrames.Content             = vt.ActualRefFrames.ToString();
                labelWidth.Content                 = vt.Width.ToString();
                labelHeight.Content                = vt.Height.ToString();
                labelFPS.Content                   = vt.FPS.ToString();
                labelVideoRecode.Content           = vt.RequiresRecode ? "Yes" : "No";
                checkBoxForceVideoRecode.IsChecked = conv.ForceVideoRecode;
            }

            var audList = conv.GetAudioTracks();

            if (audList.Count > 0)
            {
                comboBoxAudioSelection.ItemsSource       = audList;
                comboBoxAudioSelection.DisplayMemberPath = "UIDescription";
                comboBoxAudioSelection.SelectedItem      = conv.SelectedAudioTrack;
                tabItemAudio.Visibility = Visibility.Visible;
            }
            else
            {
                comboBoxAudioSelection.ItemsSource = null;
                tabItemAudio.Visibility            = Visibility.Collapsed;
            }

            // Update panel
            var at = conv.SelectedAudioTrack;

            if (at != null)
            {
                labelABitRate.Content    = String.Format("{0} Kbps", at.BitRate > 0 ? at.BitRate.ToString() : "N/A");
                labelAudioRecode.Content = at.RequiresRecode ? "Yes" : "No";
                labelNumChannels.Content = at.Channels;
            }

            var subList = conv.GetSubtitleTracks();

            if (subList.Count > 0)
            {
                comboBoxSubSelection.ItemsSource       = subList;
                comboBoxSubSelection.DisplayMemberPath = "UIDescription";
                comboBoxSubSelection.SelectedItem      = conv.SelectedSubTrack;
                SubtitlesTab.Visibility = Visibility.Visible;
            }
            else
            {
                comboBoxSubSelection.ItemsSource = null;
                SubtitlesTab.Visibility          = Visibility.Hidden;
            }
        }
예제 #15
0
        public void TestCreationInstance()
        {
            var instance = new PandaVideoConv();

            Assert.IsNotNull(instance, "Should have created instance but didn't");
        }