本文整理汇总了C#中Nikse.SubtitleEdit.Core.Subtitle.GetFastHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Subtitle.GetFastHashCode方法的具体用法?C# Subtitle.GetFastHashCode怎么用?C# Subtitle.GetFastHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nikse.SubtitleEdit.Core.Subtitle
的用法示例。
在下文中一共展示了Subtitle.GetFastHashCode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpenSubtitle
private void OpenSubtitle(string fileName, Encoding encoding, string videoFileName, string originalFileName)
{
if (File.Exists(fileName))
{
bool videoFileLoaded = false;
var file = new FileInfo(fileName);
var ext = file.Extension.ToLowerInvariant();
// save last first visible index + first selected index from listview
if (!string.IsNullOrEmpty(_fileName))
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, originalFileName);
openFileDialog1.InitialDirectory = file.DirectoryName;
if (ext == ".sub" && IsVobSubFile(fileName, false))
{
if (MessageBox.Show(this, _language.ImportThisVobSubSubtitle, _title, MessageBoxButtons.YesNo) == DialogResult.Yes)
{
ImportAndOcrVobSubSubtitleNew(fileName, _loading);
}
return;
}
if (ext == ".sup")
{
if (FileUtil.IsBluRaySup(fileName))
{
ImportAndOcrBluRaySup(fileName, _loading);
return;
}
else if (FileUtil.IsSpDvdSup(fileName))
{
ImportAndOcrSpDvdSup(fileName, _loading);
return;
}
}
if (ext == ".mkv" || ext == ".mks")
{
ImportSubtitleFromMatroskaFile(fileName);
return;
}
if (ext == ".divx" || ext == ".avi")
{
if (ImportSubtitleFromDivX(fileName))
return;
}
if ((ext == ".ts" || ext == ".rec" || ext == ".mpeg" || ext == ".mpg") && file.Length > 10000 && FileUtil.IsTransportStream(fileName))
{
ImportSubtitleFromTransportStream(fileName);
return;
}
if (((ext == ".m2ts" || ext == ".ts") && file.Length > 10000 && FileUtil.IsM2TransportStream(fileName)) ||
(ext == ".textst" && FileUtil.IsMpeg2PrivateStream2(fileName)))
{
bool isTextSt = false;
if (file.Length < 2000000)
{
var textSt = new TextST();
isTextSt = textSt.IsMine(null, fileName);
}
if (!isTextSt)
{
ImportSubtitleFromTransportStream(fileName);
return;
}
}
if ((ext == ".mp4" || ext == ".m4v" || ext == ".3gp") && file.Length > 10000)
{
if (ImportSubtitleFromMp4(fileName))
OpenVideo(fileName);
return;
}
if (ext == ".mxf")
{
if (FileUtil.IsMaterialExchangeFormat(fileName))
{
var parser = new MxfParser(fileName);
if (parser.IsValid)
{
var subtitles = parser.GetSubtitles();
if (subtitles.Count > 0)
{
SetEncoding(Configuration.Settings.General.DefaultEncoding);
encoding = GetCurrentEncoding();
var list = new List<string>(subtitles[0].SplitToLines());
_subtitle = new Subtitle();
var mxfFormat = _subtitle.ReloadLoadSubtitle(list, null, null);
SetCurrentFormat(mxfFormat);
_fileName = Path.GetFileNameWithoutExtension(fileName);
SetTitle();
ShowStatus(string.Format(_language.LoadedSubtitleX, _fileName));
_sourceViewChange = false;
_changeSubtitleToString = _subtitle.GetFastHashCode();
//.........这里部分代码省略.........
示例2: ResetSubtitle
private void ResetSubtitle()
{
SetCurrentFormat(Configuration.Settings.General.DefaultSubtitleFormat);
labelStartTimeWarning.Text = string.Empty;
labelDurationWarning.Text = string.Empty;
_subtitle = new Subtitle(_subtitle.HistoryItems);
_changeAlternateSubtitleToString = string.Empty;
_changeSubtitleToString = string.Empty;
_subtitleAlternateFileName = null;
textBoxSource.Text = string.Empty;
SubtitleListview1.Items.Clear();
_fileName = string.Empty;
_fileDateTime = new DateTime();
Text = Title;
_oldSubtitleFormat = null;
labelSingleLine.Text = string.Empty;
RemoveAlternate(true);
_splitDualSami = false;
SubtitleListview1.HideExtraColumn();
SubtitleListview1.DisplayExtraFromExtra = false;
ComboBoxSubtitleFormatsSelectedIndexChanged(null, null);
toolStripComboBoxFrameRate.Text = Configuration.Settings.General.DefaultFrameRate.ToString();
SetEncoding(Configuration.Settings.General.DefaultEncoding);
toolStripComboBoxFrameRate.Text = Configuration.Settings.General.DefaultFrameRate.ToString();
_findHelper = null;
_spellCheckForm = null;
_videoFileName = null;
_videoInfo = null;
_videoAudioTrackNumber = -1;
labelVideoInfo.Text = _languageGeneral.NoVideoLoaded;
audioVisualizer.WavePeaks = null;
audioVisualizer.Spectrogram = null;
_sourceViewChange = false;
_subtitleListViewIndex = -1;
textBoxListViewText.Text = string.Empty;
textBoxListViewTextAlternate.Text = string.Empty;
textBoxListViewText.Enabled = false;
labelTextLineLengths.Text = string.Empty;
labelCharactersPerSecond.Text = string.Empty;
labelTextLineTotal.Text = string.Empty;
_listViewTextUndoLast = null;
_listViewAlternateTextUndoLast = null;
_listViewTextUndoIndex = -1;
if (mediaPlayer.VideoPlayer != null)
{
mediaPlayer.VideoPlayer.DisposeVideoPlayer();
mediaPlayer.VideoPlayer = null;
}
_changeSubtitleToString = _subtitle.GetFastHashCode();
_converted = false;
SetUndockedWindowsTitle();
mediaPlayer.SubtitleText = string.Empty;
ShowStatus(_language.New);
ResetShowEarlierOrLater();
}
示例3: SetNewSubtitle
private void SetNewSubtitle(Subtitle subtitle)
{
_selectedParagraph = null;
var ds = new SubtitleTableDataSource(subtitle, this);
Window.SubtitleTable.DataSource = ds;
Window.SubtitleTable.Delegate = new SubtitleTableDelegate(ds, this);
ShowSubtitleRow(0);
_subtitleOriginalHash = subtitle.GetFastHashCode();
_subtitleOrginalFormat = GetCurrentSubtitleFormat().FriendlyName;
SetTitle();
}