private void openVideo(string fileName) { setControlState(true); this._oLog = MainForm.Instance.FileIndexerLog; if (_oLog == null) { _oLog = MainForm.Instance.Log.Info("FileIndexer"); MainForm.Instance.FileIndexerLog = _oLog; } gbFileInformation.Text = " File Information "; iFile = null; if (GetDVDorBluraySource(fileName, ref iFile)) { if (iFile != null) { fileName = iFile.FileName; string strText = (iFile.VideoInfo.PGCNumber > 1 ? " - PGC " + iFile.VideoInfo.PGCNumber.ToString("D2") : string.Empty) + (iFile.VideoInfo.AngleNumber > 0 ? " - Angle " + iFile.VideoInfo.AngleNumber + " " : string.Empty); if (strText.Trim().Length > 0) { gbFileInformation.Text += strText.Trim() + " "; } } } else { iFile = new MediaInfoFile(fileName, ref _oLog); } if (iFile != null && iFile.HasVideo) { strVideoCodec = iFile.VideoInfo.Track.Codec; strVideoScanType = iFile.VideoInfo.ScanType; strContainerFormat = iFile.ContainerFileTypeString; } else { strVideoCodec = strVideoScanType = strContainerFormat = string.Empty; } if (String.IsNullOrEmpty(strVideoCodec)) { txtCodecInformation.Text = " unknown"; } else { txtCodecInformation.Text = " " + strVideoCodec; } if (String.IsNullOrEmpty(strContainerFormat)) { txtContainerInformation.Text = " unknown"; } else { txtContainerInformation.Text = " " + strContainerFormat; } if (String.IsNullOrEmpty(strVideoScanType)) { txtScanTypeInformation.Text = " unknown"; } else { txtScanTypeInformation.Text = " " + strVideoScanType; } if (iFile != null && iFile.HasAudio) { audioTracks = iFile.AudioInfo.Tracks; } else { audioTracks = new List <AudioTrackInfo>(); } if (input.Filename != fileName) { input.Filename = fileName; } generateAudioList(); if (iFile != null) { IndexType newType = IndexType.NONE; iFile.recommendIndexer(out newType); if (newType == IndexType.D2V || newType == IndexType.DGM || newType == IndexType.DGI || newType == IndexType.FFMS || newType == IndexType.LSMASH) { btnD2V.Enabled = iFile.isD2VIndexable(); btnDGM.Enabled = iFile.isDGMIndexable(); btnDGI.Enabled = iFile.isDGIIndexable(); btnFFMS.Enabled = iFile.isFFMSIndexable(); btnLSMASH.Enabled = iFile.isLSMASHIndexable(); gbIndexer.Enabled = gbAudio.Enabled = gbOutput.Enabled = true; changeIndexer(newType); setControlState(false); return; } } // source file not supported btnD2V.Enabled = btnDGM.Enabled = btnDGI.Enabled = btnFFMS.Enabled = btnLSMASH.Enabled = false; gbIndexer.Enabled = gbAudio.Enabled = gbOutput.Enabled = false; btnFFMS.Checked = btnD2V.Checked = btnDGM.Checked = btnDGI.Checked = btnLSMASH.Checked = false; output.Filename = ""; demuxNoAudiotracks.Checked = true; setControlState(false); MessageBox.Show("No indexer for this file found!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
private void openVideo(string fileName) { MediaInfoFile iFile = new MediaInfoFile(fileName, ref _oLog); strVideoCodec = iFile.VideoInfo.Track.Codec; strVideoScanType = iFile.VideoInfo.ScanType; strContainerFormat = iFile.ContainerFileTypeString; audioTracks = iFile.AudioInfo.Tracks; if (String.IsNullOrEmpty(strVideoCodec)) { txtCodecInformation.Text = " unknown"; } else { txtCodecInformation.Text = " " + strVideoCodec; } if (String.IsNullOrEmpty(strContainerFormat)) { txtContainerInformation.Text = " unknown"; } else { txtContainerInformation.Text = " " + strContainerFormat; } if (String.IsNullOrEmpty(strVideoScanType)) { txtScanTypeInformation.Text = " unknown"; } else { txtScanTypeInformation.Text = " " + strVideoScanType; } cbPGC.Items.Clear(); if (iFile.VideoInfo.PGCCount <= 0) { cbPGC.Items.Add("none"); } else if (iFile.VideoInfo.PGCCount == 1) { cbPGC.Items.Add("all"); } else { cbPGC.Items.Add("all"); for (int i = 1; i < iFile.VideoInfo.PGCCount; i++) { cbPGC.Items.Add(i.ToString()); } } cbPGC.SelectedIndex = 0; cbPGC.Enabled = iFile.VideoInfo.PGCCount > 1; if (input.Filename != fileName) { input.Filename = fileName; } generateAudioList(); btnD2V.Enabled = iFile.isD2VIndexable(); btnDGA.Enabled = iFile.isDGAIndexable(); btnDGI.Enabled = iFile.isDGIIndexable(); btnFFMS.Enabled = iFile.isFFMSIndexable(); IndexType newType = IndexType.NONE; if (iFile.recommendIndexer(out newType)) { gbIndexer.Enabled = gbAudio.Enabled = gbOutput.Enabled = true; changeIndexer(newType); } else { gbIndexer.Enabled = gbAudio.Enabled = gbOutput.Enabled = false; btnFFMS.Checked = btnD2V.Checked = btnDGA.Checked = btnDGI.Checked = false; output.Text = ""; demuxNoAudiotracks.Checked = true; MessageBox.Show("No indexer for this file found. Please try open it directly in the AVS Script Creator", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }