string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { if (string.IsNullOrWhiteSpace(subtitle)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } if (!string.IsNullOrEmpty(listViewLineSeparatorString)) { Options.UILineBreak = listViewLineSeparatorString; } var list = subtitle.SplitToLines(); var srt = new SubRip(); var sub = new Subtitle(srt); srt.LoadSubtitle(sub, list, subtitleFileName); using (var form = new PluginForm(sub)) { if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.Subtiitle); } } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { subtitle = subtitle.Trim(); if (string.IsNullOrEmpty(subtitle)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } if (!string.IsNullOrEmpty(listViewLineSeparatorString)) { Configuration.ListViewLineSeparatorString = listViewLineSeparatorString; } var list = subtitle.Replace(Environment.NewLine, "\n").Split('\n').ToList(); var srt = new SubRip(); var sub = new Subtitle(srt); srt.LoadSubtitle(sub, list, subtitleFileName); if (srt.ErrorCount > 0) { MessageBox.Show(srt.ErrorCount + " Errors found while parsing .srt", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } using (var form = new PluginForm(sub, (this as IPlugin).Name, (this as IPlugin).Description, parentForm, srt.ErrorCount)) { if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.FixedSubtitle); } } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { var form = new PluginForm((this as IPlugin).Name, (this as IPlugin).Description); if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.LoadedSubtitle); } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { if (!string.IsNullOrEmpty(subtitleFileName)) { subtitleFileName = Path.GetFileName(subtitleFileName); } var form = new PluginForm(subtitleFileName, rawText, (this as IPlugin).Name, (this as IPlugin).Description); form.ShowDialog(parentForm); return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { subtitleFileName = subtitleFileName.Trim(); if (!string.IsNullOrEmpty(subtitleFileName)) { var form = new PluginForm((this as IPlugin).Name, (this as IPlugin).Description, subtitleFileName, rawText); if (form.ShowDialog(parentForm) == DialogResult.OK) { } } else { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { subtitle = subtitle.Trim(); if (string.IsNullOrWhiteSpace(subtitle)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } if (!IsOfficeInstalled()) { MessageBox.Show(@"Microsoft Office (Word) is not installed in this system.", "Office is not installed!!!", MessageBoxButtons.OK, MessageBoxIcon.Error); return(string.Empty); } // set frame rate Configuration.CurrentFrameRate = frameRate; // set newline visualizer for listviews if (!string.IsNullOrEmpty(listViewLineSeparatorString)) { Configuration.ListViewLineSeparatorString = listViewLineSeparatorString; } // load subtitle text into object var list = new List <string>(); foreach (string line in subtitle.Replace(Environment.NewLine, "\n").Split('\n')) { list.Add(line); } var sub = new Subtitle(); var srt = new SubRip(); srt.LoadSubtitle(sub, list, subtitleFileName); var form = new PluginForm(sub, (this as IPlugin).Name, (this as IPlugin).Description); if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.FixedSubtitle); } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { if (string.IsNullOrWhiteSpace(subtitleFileName)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); return(string.Empty); } if (!File.Exists(subtitleFileName)) { MessageBox.Show("File not found. Make sure you saved before running!", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } using (var form = new PluginForm(subtitleFileName, rawText, videoFileName, (this as IPlugin).Name, (this as IPlugin).Description)) { form.ShowDialog(parentForm); } return(string.Empty); }
string IPlugin.DoAction(Form parentForm, string subtitle, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { if (string.IsNullOrWhiteSpace(subtitle)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } // set frame rate Configuration.CurrentFrameRate = frameRate; // set newline visualizer for listviews if (!string.IsNullOrEmpty(listViewLineSeparatorString)) { Configuration.ListViewLineSeparatorString = listViewLineSeparatorString; } // load subtitle text into object var list = new List <string>(); foreach (string line in subtitle.SplitToLines()) { list.Add(line); } var sub = new Subtitle(); var srt = new SubRip(); srt.LoadSubtitle(sub, list, subtitleFileName); IPlugin plugin = this; using (var form = new PluginForm(sub, plugin.Name, plugin.Description)) { if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.FixedSubtitle); } } return(string.Empty); }
decimal IPlugin.Version => 3.3M; //Gets or sets the major, minor, build, and revision numbers of the assembly #endregion string IPlugin.DoAction(Form parentForm, string subtitleText, double frameRate, string listViewLineSeparatorString, string subtitleFileName, string videoFileName, string rawText) { // Make sure subtitle isn't null or empty if (string.IsNullOrWhiteSpace(subtitleText)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } // Use custom separator for list view new lines if (!string.IsNullOrEmpty(listViewLineSeparatorString)) { Configuration.ListViewLineSeparatorString = listViewLineSeparatorString; } // Get subtitle raw lines var list = new List <string>(); list.AddRange(subtitleText.SplitToLines()); var srt = new SubRip(); var sub = new Subtitle(srt); // Load raws subtitle lines into Subtitle object srt.LoadSubtitle(sub, list, subtitleFileName); IPlugin HI2UC = this; using (var form = new PluginForm(sub, HI2UC.Name, HI2UC.Description)) { if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.FixedSubtitle); } } return(string.Empty); }
public string DoAction(Form parentForm, string srtText, double frame, string uiLineBreak, string file, string videoFile, string rawText) { // Make sure subtitle isn't null or empty if (string.IsNullOrWhiteSpace(srtText)) { MessageBox.Show("No subtitle loaded", parentForm.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(string.Empty); } // Use custom separator for list view new lines if (!string.IsNullOrEmpty(uiLineBreak)) { Options.UILineBreak = uiLineBreak; } // Get subtitle raw lines var list = new List <string>(srtText.SplitToLines()); var srt = new SubRip(); var sub = new Subtitle(srt); // Load raws subtitle lines into Subtitle object srt.LoadSubtitle(sub, list, file); IPlugin hi2Uc = this; using (var form = new PluginForm(sub, hi2Uc.Name, hi2Uc.Description)) { if (form.ShowDialog(parentForm) == DialogResult.OK) { return(form.Subtitle); } } return(string.Empty); }