Updated language + working on FCP xml

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@286 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-01-28 20:29:55 +00:00
parent 0c767e72ad
commit 821b9d0f9c
15 changed files with 400 additions and 49 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
@ -17,6 +18,18 @@ namespace Nikse.SubtitleEdit.Forms
Text = Configuration.Settings.Language.GoToLine.Title;
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
FixLargeFonts();
}
private void FixLargeFonts()
{
Graphics graphics = this.CreateGraphics();
SizeF textSize = graphics.MeasureString(buttonOK.Text, this.Font);
if (textSize.Height > buttonOK.Height - 4)
{
int newButtonHeight = (int)(textSize.Height + 7 + 0.5);
Utilities.SetButtonHeight(this, newButtonHeight, 1);
}
}
public int LineNumber

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Net;
using System.Text;
@ -7,7 +8,6 @@ using System.Text.RegularExpressions;
using System.Web;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
using System.Drawing;
namespace Nikse.SubtitleEdit.Forms
{

View File

@ -54,7 +54,7 @@
//
this.buttonRemove.Location = new System.Drawing.Point(159, 16);
this.buttonRemove.Name = "buttonRemove";
this.buttonRemove.Size = new System.Drawing.Size(75, 23);
this.buttonRemove.Size = new System.Drawing.Size(75, 21);
this.buttonRemove.TabIndex = 22;
this.buttonRemove.Text = "Remove";
this.buttonRemove.UseVisualStyleBackColor = true;
@ -79,9 +79,9 @@
//
// buttonAdd
//
this.buttonAdd.Location = new System.Drawing.Point(159, 217);
this.buttonAdd.Location = new System.Drawing.Point(159, 219);
this.buttonAdd.Name = "buttonAdd";
this.buttonAdd.Size = new System.Drawing.Size(75, 23);
this.buttonAdd.Size = new System.Drawing.Size(75, 21);
this.buttonAdd.TabIndex = 26;
this.buttonAdd.Text = "Add";
this.buttonAdd.UseVisualStyleBackColor = true;

View File

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic;
@ -38,6 +39,19 @@ namespace Nikse.SubtitleEdit.Forms
_interjections.Add(s.Trim());
}
FillListBox();
Text = Configuration.Settings.Language.Interjections.Title;
FixLargeFonts();
}
private void FixLargeFonts()
{
Graphics graphics = this.CreateGraphics();
SizeF textSize = graphics.MeasureString(buttonOK.Text, this.Font);
if (textSize.Height > buttonOK.Height - 4)
{
int newButtonHeight = (int)(textSize.Height + 7 + 0.5);
Utilities.SetButtonHeight(this, newButtonHeight, 1);
}
}
private void buttonAdd_Click(object sender, EventArgs e)

View File

@ -125,6 +125,7 @@
this.appendTextVisuallyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemVideo = new System.Windows.Forms.ToolStripMenuItem();
this.openVideoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItemSetAudioTrack = new System.Windows.Forms.ToolStripMenuItem();
this.closeVideoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.showhideWaveFormToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -1202,6 +1203,7 @@
//
this.toolStripMenuItemVideo.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.openVideoToolStripMenuItem,
this.toolStripMenuItemSetAudioTrack,
this.closeVideoToolStripMenuItem,
this.toolStripSeparator5,
this.showhideWaveFormToolStripMenuItem,
@ -1213,6 +1215,7 @@
this.toolStripMenuItemVideo.Size = new System.Drawing.Size(50, 20);
this.toolStripMenuItemVideo.Text = "Video";
this.toolStripMenuItemVideo.DropDownOpening += new System.EventHandler(this.toolStripMenuItemVideo_DropDownOpening);
this.toolStripMenuItemVideo.Click += new System.EventHandler(this.toolStripMenuItemVideo_Click);
//
// openVideoToolStripMenuItem
//
@ -1221,6 +1224,12 @@
this.openVideoToolStripMenuItem.Text = "Open video...";
this.openVideoToolStripMenuItem.Click += new System.EventHandler(this.buttonOpenVideo_Click);
//
// toolStripMenuItemSetAudioTrack
//
this.toolStripMenuItemSetAudioTrack.Name = "toolStripMenuItemSetAudioTrack";
this.toolStripMenuItemSetAudioTrack.Size = new System.Drawing.Size(199, 22);
this.toolStripMenuItemSetAudioTrack.Text = "Choose audio track";
//
// closeVideoToolStripMenuItem
//
this.closeVideoToolStripMenuItem.Name = "closeVideoToolStripMenuItem";
@ -3712,6 +3721,7 @@
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemPlayRateFast;
private System.Windows.Forms.ImageList imageListPlayRate;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemPlayRateVeryFast;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSetAudioTrack;
}
}

View File

@ -104,7 +104,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2];
}
return _title + " Beta 11";
return _title + " Beta 12";
}
}
@ -559,6 +559,7 @@ namespace Nikse.SubtitleEdit.Forms
toolStripMenuItemVideo.Text = _language.Menu.Video.Title;
openVideoToolStripMenuItem.Text = _language.Menu.Video.OpenVideo;
toolStripMenuItemSetAudioTrack.Text = _language.Menu.Video.ChooseAudioTrack;
closeVideoToolStripMenuItem.Text = _language.Menu.Video.CloseVideo;
showhideWaveFormToolStripMenuItem.Text = _language.Menu.Video.ShowHideWaveForm;
showhideVideoToolStripMenuItem.Text = _language.Menu.Video.ShowHideVideo;
@ -3719,7 +3720,42 @@ namespace Nikse.SubtitleEdit.Forms
private void TextBoxListViewTextKeyDown(object sender, KeyEventArgs e)
{
int numberOfNewLines = textBoxListViewText.Text.Length - textBoxListViewText.Text.Replace(Environment.NewLine, " ").Length;
if (e.KeyCode == Keys.Enter && numberOfNewLines > 1)
if (e.Modifiers == Keys.None && numberOfNewLines < 1 && textBoxListViewText.Text.Length > Configuration.Settings.General.SubtitleLineMaximumLength-5)
{
if (1 == 1) // auto break setting!
{
string newText;
if (textBoxListViewText.Text.Length > Configuration.Settings.General.SubtitleLineMaximumLength + 30)
{
newText = Utilities.AutoBreakLine(textBoxListViewText.Text);
}
else
{
int lastSpace = textBoxListViewText.Text.LastIndexOf(' ');
if (lastSpace > 0)
newText = textBoxListViewText.Text.Remove(lastSpace, 1).Insert(lastSpace, Environment.NewLine);
else
newText = textBoxListViewText.Text;
}
int autobreakIndex = newText.IndexOf(Environment.NewLine);
if (autobreakIndex > 0)
{
int selectionStart = textBoxListViewText.SelectionStart;
int selectionLength = textBoxListViewText.SelectionLength;
textBoxListViewText.Text = newText;
if (selectionStart > autobreakIndex)
selectionStart += Environment.NewLine.Length;
if (selectionStart >= 0)
textBoxListViewText.SelectionStart = selectionStart;
if (selectionLength >= 0)
textBoxListViewText.SelectionLength = selectionLength;
}
}
}
if (e.KeyCode == Keys.Enter && e.Modifiers == Keys.None && numberOfNewLines > 1)
{
e.SuppressKeyPress = true;
}
@ -8769,6 +8805,38 @@ namespace Nikse.SubtitleEdit.Forms
private void toolStripMenuItemVideo_DropDownOpening(object sender, EventArgs e)
{
closeVideoToolStripMenuItem.Visible = !string.IsNullOrEmpty(_videoFileName);
toolStripMenuItemSetAudioTrack.Visible = false;
if (mediaPlayer.VideoPlayer != null && mediaPlayer.VideoPlayer is Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic)
{
var libVlc = (Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic)mediaPlayer.VideoPlayer;
int numberOfTracks = libVlc.AudioTrackCount;
int currentTrackNumber = libVlc.AudioTrackNumber;
if (numberOfTracks > 2)
{
toolStripMenuItemSetAudioTrack.DropDownItems.Clear();
for (int i = 0; i < numberOfTracks-1; i++)
{
toolStripMenuItemSetAudioTrack.DropDownItems.Add((i + 1).ToString(), null, ChooseAudioTrack);
if (i+1 == currentTrackNumber)
toolStripMenuItemSetAudioTrack.DropDownItems[toolStripMenuItemSetAudioTrack.DropDownItems.Count - 1].Select();
}
toolStripMenuItemSetAudioTrack.Visible = true;
}
}
}
private void ChooseAudioTrack(object sender, EventArgs e)
{
if (mediaPlayer.VideoPlayer != null && mediaPlayer.VideoPlayer is Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic)
{
var libVlc = (Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic)mediaPlayer.VideoPlayer;
var item = sender as ToolStripItem;
int number = int.Parse(item.Text);
libVlc.AudioTrackNumber = number;
}
}
private void textBoxListViewTextAlternate_TextChanged(object sender, EventArgs e)
@ -8798,7 +8866,42 @@ namespace Nikse.SubtitleEdit.Forms
return;
int numberOfNewLines = textBoxListViewTextAlternate.Text.Length - textBoxListViewTextAlternate.Text.Replace(Environment.NewLine, " ").Length;
if (e.KeyCode == Keys.Enter && numberOfNewLines > 1)
if (e.Modifiers == Keys.None && numberOfNewLines < 1 && textBoxListViewTextAlternate.Text.Length >= Configuration.Settings.General.SubtitleLineMaximumLength)
{
if (1 == 1) // auto break setting!
{
string newText;
if (textBoxListViewTextAlternate.Text.Length > Configuration.Settings.General.SubtitleLineMaximumLength + 30)
{
newText = Utilities.AutoBreakLine(textBoxListViewTextAlternate.Text);
}
else
{
int lastSpace = textBoxListViewTextAlternate.Text.LastIndexOf(' ');
if (lastSpace > 0)
newText = textBoxListViewTextAlternate.Text.Remove(lastSpace, 1).Insert(lastSpace, Environment.NewLine);
else
newText = textBoxListViewTextAlternate.Text;
}
int autobreakIndex = newText.IndexOf(Environment.NewLine);
if (autobreakIndex > 0)
{
int selectionStart = textBoxListViewTextAlternate.SelectionStart;
int selectionLength = textBoxListViewTextAlternate.SelectionLength;
textBoxListViewTextAlternate.Text = newText;
if (selectionStart > autobreakIndex)
selectionStart += Environment.NewLine.Length;
if (selectionStart >= 0)
textBoxListViewTextAlternate.SelectionStart = selectionStart;
if (selectionLength >= 0)
textBoxListViewTextAlternate.SelectionLength = selectionLength;
}
}
}
if (e.KeyCode == Keys.Enter && e.Modifiers == Keys.None && numberOfNewLines > 1)
{
e.SuppressKeyPress = true;
}
@ -8996,5 +9099,10 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void toolStripMenuItemVideo_Click(object sender, EventArgs e)
{
}
}
}

View File

@ -684,7 +684,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
CAAAAk1TRnQBSQFMAgEBAgEAAfABAAHwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAATABAQEwAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -195,6 +195,7 @@
this.colorDialogSSAStyle = new System.Windows.Forms.ColorDialog();
this.fontDialogSSAStyle = new System.Windows.Forms.FontDialog();
this.labelStatus = new System.Windows.Forms.Label();
this.checkBoxAutoWrapWhileTyping = new System.Windows.Forms.CheckBox();
this.tabControlSettings.SuspendLayout();
this.tabPageGenerel.SuspendLayout();
this.groupBoxMiscellaneous.SuspendLayout();
@ -286,6 +287,7 @@
//
// groupBoxMiscellaneous
//
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxAutoWrapWhileTyping);
this.groupBoxMiscellaneous.Controls.Add(this.labelMergeShortLines);
this.groupBoxMiscellaneous.Controls.Add(this.comboBoxMergeShortLineLength);
this.groupBoxMiscellaneous.Controls.Add(this.checkBoxAllowEditOfOriginalSubtitle);
@ -330,7 +332,7 @@
// labelMergeShortLines
//
this.labelMergeShortLines.AutoSize = true;
this.labelMergeShortLines.Location = new System.Drawing.Point(14, 153);
this.labelMergeShortLines.Location = new System.Drawing.Point(14, 176);
this.labelMergeShortLines.Name = "labelMergeShortLines";
this.labelMergeShortLines.Size = new System.Drawing.Size(124, 13);
this.labelMergeShortLines.TabIndex = 39;
@ -340,18 +342,18 @@
//
this.comboBoxMergeShortLineLength.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxMergeShortLineLength.FormattingEnabled = true;
this.comboBoxMergeShortLineLength.Location = new System.Drawing.Point(193, 150);
this.comboBoxMergeShortLineLength.Location = new System.Drawing.Point(193, 173);
this.comboBoxMergeShortLineLength.Name = "comboBoxMergeShortLineLength";
this.comboBoxMergeShortLineLength.Size = new System.Drawing.Size(73, 21);
this.comboBoxMergeShortLineLength.TabIndex = 4;
this.comboBoxMergeShortLineLength.TabIndex = 5;
//
// checkBoxAllowEditOfOriginalSubtitle
//
this.checkBoxAllowEditOfOriginalSubtitle.AutoSize = true;
this.checkBoxAllowEditOfOriginalSubtitle.Location = new System.Drawing.Point(436, 296);
this.checkBoxAllowEditOfOriginalSubtitle.Name = "checkBoxAllowEditOfOriginalSubtitle";
this.checkBoxAllowEditOfOriginalSubtitle.Size = new System.Drawing.Size(155, 17);
this.checkBoxAllowEditOfOriginalSubtitle.TabIndex = 23;
this.checkBoxAllowEditOfOriginalSubtitle.Size = new System.Drawing.Size(160, 17);
this.checkBoxAllowEditOfOriginalSubtitle.TabIndex = 24;
this.checkBoxAllowEditOfOriginalSubtitle.Text = "Allow edit of original subtitle";
this.checkBoxAllowEditOfOriginalSubtitle.UseVisualStyleBackColor = true;
//
@ -362,15 +364,15 @@
this.comboBoxSpellChecker.Items.AddRange(new object[] {
"Hunspell",
"Word"});
this.comboBoxSpellChecker.Location = new System.Drawing.Point(193, 332);
this.comboBoxSpellChecker.Location = new System.Drawing.Point(193, 354);
this.comboBoxSpellChecker.Name = "comboBoxSpellChecker";
this.comboBoxSpellChecker.Size = new System.Drawing.Size(121, 21);
this.comboBoxSpellChecker.TabIndex = 10;
this.comboBoxSpellChecker.TabIndex = 11;
//
// labelSpellChecker
//
this.labelSpellChecker.AutoSize = true;
this.labelSpellChecker.Location = new System.Drawing.Point(14, 335);
this.labelSpellChecker.Location = new System.Drawing.Point(14, 357);
this.labelSpellChecker.Name = "labelSpellChecker";
this.labelSpellChecker.Size = new System.Drawing.Size(69, 13);
this.labelSpellChecker.TabIndex = 36;
@ -379,25 +381,25 @@
// panelSubtitleBackgroundColor
//
this.panelSubtitleBackgroundColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelSubtitleBackgroundColor.Location = new System.Drawing.Point(193, 287);
this.panelSubtitleBackgroundColor.Location = new System.Drawing.Point(193, 309);
this.panelSubtitleBackgroundColor.Name = "panelSubtitleBackgroundColor";
this.panelSubtitleBackgroundColor.Size = new System.Drawing.Size(46, 15);
this.panelSubtitleBackgroundColor.TabIndex = 9;
this.panelSubtitleBackgroundColor.TabIndex = 10;
this.panelSubtitleBackgroundColor.Click += new System.EventHandler(this.panelSubtitleBackgroundColor_Click);
//
// panelSubtitleFontColor
//
this.panelSubtitleFontColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panelSubtitleFontColor.Location = new System.Drawing.Point(193, 267);
this.panelSubtitleFontColor.Location = new System.Drawing.Point(193, 289);
this.panelSubtitleFontColor.Name = "panelSubtitleFontColor";
this.panelSubtitleFontColor.Size = new System.Drawing.Size(46, 15);
this.panelSubtitleFontColor.TabIndex = 8;
this.panelSubtitleFontColor.TabIndex = 9;
this.panelSubtitleFontColor.Click += new System.EventHandler(this.panelSubtitleFontColor_Click);
//
// labelSubtitleFontBackgroundColor
//
this.labelSubtitleFontBackgroundColor.AutoSize = true;
this.labelSubtitleFontBackgroundColor.Location = new System.Drawing.Point(14, 288);
this.labelSubtitleFontBackgroundColor.Location = new System.Drawing.Point(14, 310);
this.labelSubtitleFontBackgroundColor.Name = "labelSubtitleFontBackgroundColor";
this.labelSubtitleFontBackgroundColor.Size = new System.Drawing.Size(151, 13);
this.labelSubtitleFontBackgroundColor.TabIndex = 33;
@ -406,7 +408,7 @@
// labelSubtitleFontColor
//
this.labelSubtitleFontColor.AutoSize = true;
this.labelSubtitleFontColor.Location = new System.Drawing.Point(14, 268);
this.labelSubtitleFontColor.Location = new System.Drawing.Point(14, 290);
this.labelSubtitleFontColor.Name = "labelSubtitleFontColor";
this.labelSubtitleFontColor.Size = new System.Drawing.Size(92, 13);
this.labelSubtitleFontColor.TabIndex = 32;
@ -424,7 +426,7 @@
this.comboBoxAutoBackup.Location = new System.Drawing.Point(539, 252);
this.comboBoxAutoBackup.Name = "comboBoxAutoBackup";
this.comboBoxAutoBackup.Size = new System.Drawing.Size(121, 21);
this.comboBoxAutoBackup.TabIndex = 22;
this.comboBoxAutoBackup.TabIndex = 23;
//
// labelAutoBackup
//
@ -432,7 +434,7 @@
this.labelAutoBackup.Location = new System.Drawing.Point(433, 254);
this.labelAutoBackup.Name = "labelAutoBackup";
this.labelAutoBackup.Size = new System.Drawing.Size(68, 13);
this.labelAutoBackup.TabIndex = 21;
this.labelAutoBackup.TabIndex = 22;
this.labelAutoBackup.Text = "Auto-backup";
//
// checkBoxRememberSelectedLine
@ -441,7 +443,7 @@
this.checkBoxRememberSelectedLine.Location = new System.Drawing.Point(444, 75);
this.checkBoxRememberSelectedLine.Name = "checkBoxRememberSelectedLine";
this.checkBoxRememberSelectedLine.Size = new System.Drawing.Size(139, 17);
this.checkBoxRememberSelectedLine.TabIndex = 13;
this.checkBoxRememberSelectedLine.TabIndex = 14;
this.checkBoxRememberSelectedLine.Text = "Remember selected line";
this.checkBoxRememberSelectedLine.UseVisualStyleBackColor = true;
//
@ -451,7 +453,7 @@
this.checkBoxRemoveBlankLinesWhenOpening.Location = new System.Drawing.Point(436, 147);
this.checkBoxRemoveBlankLinesWhenOpening.Name = "checkBoxRemoveBlankLinesWhenOpening";
this.checkBoxRemoveBlankLinesWhenOpening.Size = new System.Drawing.Size(225, 17);
this.checkBoxRemoveBlankLinesWhenOpening.TabIndex = 16;
this.checkBoxRemoveBlankLinesWhenOpening.TabIndex = 17;
this.checkBoxRemoveBlankLinesWhenOpening.Text = "Remove blank lines when opening subtitle";
this.checkBoxRemoveBlankLinesWhenOpening.UseVisualStyleBackColor = true;
//
@ -485,7 +487,7 @@
this.comboBoxListViewDoubleClickEvent.Location = new System.Drawing.Point(436, 217);
this.comboBoxListViewDoubleClickEvent.Name = "comboBoxListViewDoubleClickEvent";
this.comboBoxListViewDoubleClickEvent.Size = new System.Drawing.Size(222, 21);
this.comboBoxListViewDoubleClickEvent.TabIndex = 20;
this.comboBoxListViewDoubleClickEvent.TabIndex = 21;
//
// labelListViewDoubleClickEvent
//
@ -493,7 +495,7 @@
this.labelListViewDoubleClickEvent.Location = new System.Drawing.Point(433, 202);
this.labelListViewDoubleClickEvent.Name = "labelListViewDoubleClickEvent";
this.labelListViewDoubleClickEvent.Size = new System.Drawing.Size(227, 13);
this.labelListViewDoubleClickEvent.TabIndex = 19;
this.labelListViewDoubleClickEvent.TabIndex = 20;
this.labelListViewDoubleClickEvent.Text = "Double-click on line in main window listview will";
//
// textBoxShowLineBreaksAs
@ -502,7 +504,7 @@
this.textBoxShowLineBreaksAs.MaxLength = 10;
this.textBoxShowLineBreaksAs.Name = "textBoxShowLineBreaksAs";
this.textBoxShowLineBreaksAs.Size = new System.Drawing.Size(69, 21);
this.textBoxShowLineBreaksAs.TabIndex = 18;
this.textBoxShowLineBreaksAs.TabIndex = 19;
//
// labelShowLineBreaksAs
//
@ -510,7 +512,7 @@
this.labelShowLineBreaksAs.Location = new System.Drawing.Point(433, 175);
this.labelShowLineBreaksAs.Name = "labelShowLineBreaksAs";
this.labelShowLineBreaksAs.Size = new System.Drawing.Size(150, 13);
this.labelShowLineBreaksAs.TabIndex = 17;
this.labelShowLineBreaksAs.TabIndex = 18;
this.labelShowLineBreaksAs.Text = "Show line breaks in listview as";
//
// checkBoxRememberWindowPosition
@ -518,8 +520,8 @@
this.checkBoxRememberWindowPosition.AutoSize = true;
this.checkBoxRememberWindowPosition.Location = new System.Drawing.Point(436, 101);
this.checkBoxRememberWindowPosition.Name = "checkBoxRememberWindowPosition";
this.checkBoxRememberWindowPosition.Size = new System.Drawing.Size(222, 17);
this.checkBoxRememberWindowPosition.TabIndex = 14;
this.checkBoxRememberWindowPosition.Size = new System.Drawing.Size(223, 17);
this.checkBoxRememberWindowPosition.TabIndex = 15;
this.checkBoxRememberWindowPosition.Text = "Remember main window position and size";
this.checkBoxRememberWindowPosition.UseVisualStyleBackColor = true;
//
@ -545,7 +547,7 @@
// labelSubtitleFontSize
//
this.labelSubtitleFontSize.AutoSize = true;
this.labelSubtitleFontSize.Location = new System.Drawing.Point(13, 223);
this.labelSubtitleFontSize.Location = new System.Drawing.Point(13, 245);
this.labelSubtitleFontSize.Name = "labelSubtitleFontSize";
this.labelSubtitleFontSize.Size = new System.Drawing.Size(87, 13);
this.labelSubtitleFontSize.TabIndex = 10;
@ -555,18 +557,18 @@
//
this.comboBoxSubtitleFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxSubtitleFont.FormattingEnabled = true;
this.comboBoxSubtitleFont.Location = new System.Drawing.Point(193, 192);
this.comboBoxSubtitleFont.Location = new System.Drawing.Point(193, 214);
this.comboBoxSubtitleFont.Name = "comboBoxSubtitleFont";
this.comboBoxSubtitleFont.Size = new System.Drawing.Size(121, 21);
this.comboBoxSubtitleFont.TabIndex = 5;
this.comboBoxSubtitleFont.TabIndex = 6;
//
// checkBoxStartInSourceView
//
this.checkBoxStartInSourceView.AutoSize = true;
this.checkBoxStartInSourceView.Location = new System.Drawing.Point(436, 124);
this.checkBoxStartInSourceView.Name = "checkBoxStartInSourceView";
this.checkBoxStartInSourceView.Size = new System.Drawing.Size(119, 17);
this.checkBoxStartInSourceView.TabIndex = 15;
this.checkBoxStartInSourceView.Size = new System.Drawing.Size(121, 17);
this.checkBoxStartInSourceView.TabIndex = 16;
this.checkBoxStartInSourceView.Text = "Start in source view";
this.checkBoxStartInSourceView.UseVisualStyleBackColor = true;
//
@ -575,8 +577,8 @@
this.checkBoxReopenLastOpened.AutoSize = true;
this.checkBoxReopenLastOpened.Location = new System.Drawing.Point(444, 52);
this.checkBoxReopenLastOpened.Name = "checkBoxReopenLastOpened";
this.checkBoxReopenLastOpened.Size = new System.Drawing.Size(140, 17);
this.checkBoxReopenLastOpened.TabIndex = 12;
this.checkBoxReopenLastOpened.Size = new System.Drawing.Size(145, 17);
this.checkBoxReopenLastOpened.TabIndex = 13;
this.checkBoxReopenLastOpened.Text = "Start with last file loaded";
this.checkBoxReopenLastOpened.UseVisualStyleBackColor = true;
//
@ -585,8 +587,8 @@
this.checkBoxRememberRecentFiles.AutoSize = true;
this.checkBoxRememberRecentFiles.Location = new System.Drawing.Point(436, 28);
this.checkBoxRememberRecentFiles.Name = "checkBoxRememberRecentFiles";
this.checkBoxRememberRecentFiles.Size = new System.Drawing.Size(188, 17);
this.checkBoxRememberRecentFiles.TabIndex = 11;
this.checkBoxRememberRecentFiles.Size = new System.Drawing.Size(195, 17);
this.checkBoxRememberRecentFiles.TabIndex = 12;
this.checkBoxRememberRecentFiles.Text = "Remember recent files (for reopen)";
this.checkBoxRememberRecentFiles.UseVisualStyleBackColor = true;
this.checkBoxRememberRecentFiles.CheckedChanged += new System.EventHandler(this.checkBoxRememberRecentFiles_CheckedChanged);
@ -594,10 +596,10 @@
// checkBoxSubtitleFontBold
//
this.checkBoxSubtitleFontBold.AutoSize = true;
this.checkBoxSubtitleFontBold.Location = new System.Drawing.Point(193, 247);
this.checkBoxSubtitleFontBold.Location = new System.Drawing.Point(193, 269);
this.checkBoxSubtitleFontBold.Name = "checkBoxSubtitleFontBold";
this.checkBoxSubtitleFontBold.Size = new System.Drawing.Size(47, 17);
this.checkBoxSubtitleFontBold.TabIndex = 7;
this.checkBoxSubtitleFontBold.Size = new System.Drawing.Size(46, 17);
this.checkBoxSubtitleFontBold.TabIndex = 8;
this.checkBoxSubtitleFontBold.Text = "Bold";
this.checkBoxSubtitleFontBold.UseVisualStyleBackColor = true;
//
@ -620,15 +622,15 @@
"18",
"19",
"20"});
this.comboBoxSubtitleFontSize.Location = new System.Drawing.Point(193, 220);
this.comboBoxSubtitleFontSize.Location = new System.Drawing.Point(193, 242);
this.comboBoxSubtitleFontSize.Name = "comboBoxSubtitleFontSize";
this.comboBoxSubtitleFontSize.Size = new System.Drawing.Size(121, 21);
this.comboBoxSubtitleFontSize.TabIndex = 6;
this.comboBoxSubtitleFontSize.TabIndex = 7;
//
// labelSubtitleFont
//
this.labelSubtitleFont.AutoSize = true;
this.labelSubtitleFont.Location = new System.Drawing.Point(13, 198);
this.labelSubtitleFont.Location = new System.Drawing.Point(13, 220);
this.labelSubtitleFont.Name = "labelSubtitleFont";
this.labelSubtitleFont.Size = new System.Drawing.Size(66, 13);
this.labelSubtitleFont.TabIndex = 8;
@ -1986,6 +1988,16 @@
this.labelStatus.TabIndex = 3;
this.labelStatus.Text = "labelStatus";
//
// checkBoxAutoWrapWhileTyping
//
this.checkBoxAutoWrapWhileTyping.AutoSize = true;
this.checkBoxAutoWrapWhileTyping.Location = new System.Drawing.Point(193, 146);
this.checkBoxAutoWrapWhileTyping.Name = "checkBoxAutoWrapWhileTyping";
this.checkBoxAutoWrapWhileTyping.Size = new System.Drawing.Size(137, 17);
this.checkBoxAutoWrapWhileTyping.TabIndex = 4;
this.checkBoxAutoWrapWhileTyping.Text = "Auto-wrap while typing";
this.checkBoxAutoWrapWhileTyping.UseVisualStyleBackColor = true;
//
// Settings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -2234,5 +2246,6 @@
private System.Windows.Forms.CheckBox checkBoxAllowEditOfOriginalSubtitle;
private System.Windows.Forms.Label labelMergeShortLines;
private System.Windows.Forms.ComboBox comboBoxMergeShortLineLength;
private System.Windows.Forms.CheckBox checkBoxAutoWrapWhileTyping;
}
}

View File

@ -73,6 +73,7 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxRemoveBlankLinesWhenOpening.Checked = gs.RemoveBlankLinesWhenOpening;
checkBoxRememberWindowPosition.Checked = gs.StartRememberPositionAndSize;
textBoxSubtitleLineMaximumLength.Text = gs.SubtitleLineMaximumLength.ToString();
checkBoxAutoWrapWhileTyping.Checked = gs.AutoWrapLineWhileTyping;
textBoxShowLineBreaksAs.Text = gs.ListViewLineSeparatorString;
if (string.Compare(gs.VideoPlayer.Trim(), "VLC", true) == 0)
@ -177,6 +178,7 @@ namespace Nikse.SubtitleEdit.Forms
labelDefaultFileEncoding.Text = language.DefaultFileEncoding;
labelAutoDetectAnsiEncoding.Text = language.AutoDetectAnsiEncoding;
labelSubMaxLen.Text = language.SubtitleLineMaximumLength;
checkBoxAutoWrapWhileTyping.Text = language.AutoWrapWhileTyping;
labelSubtitleFont.Text = language.SubtitleFont;
labelSubtitleFontSize.Text = language.SubtitleFontSize;
labelSubtitleFontColor.Text = language.SubtitleFontColor;
@ -602,6 +604,7 @@ namespace Nikse.SubtitleEdit.Forms
{
gs.SubtitleLineMaximumLength = 68;
}
gs.AutoWrapLineWhileTyping = checkBoxAutoWrapWhileTyping.Checked;
if (comboBoxSubtitleFont.SelectedItem != null)
gs.SubtitleFontName = comboBoxSubtitleFont.SelectedItem.ToString();

View File

@ -34,6 +34,7 @@ namespace Nikse.SubtitleEdit.Logic
public LanguageStructure.GoogleTranslate GoogleTranslate;
public LanguageStructure.GoToLine GoToLine;
public LanguageStructure.ImportText ImportText;
public LanguageStructure.Interjections Interjections;
public LanguageStructure.Main Main;
public LanguageStructure.MatroskaSubtitleChooser MatroskaSubtitleChooser;
public LanguageStructure.MergeShortLines MergedShortLines;
@ -479,6 +480,11 @@ namespace Nikse.SubtitleEdit.Logic
PreviewLinesModifiedX = "Preview - paragraphs modified: {0}",
};
Interjections = new LanguageStructure.Interjections
{
Title = "Interjections",
};
Main = new LanguageStructure.Main
{
SaveChangesToUntitled = "Save changes to untitled?",
@ -736,6 +742,7 @@ namespace Nikse.SubtitleEdit.Logic
{
Title = "Video",
OpenVideo = "Open video file...",
ChooseAudioTrack = "Choose audio track",
CloseVideo = "Close video file",
ShowHideVideo = "Show/hide video",
ShowHideWaveForm = "Show/hide wave form",
@ -1055,6 +1062,7 @@ can edit in same subtitle file (collaboration)",
DefaultFileEncoding = "Default file encoding",
AutoDetectAnsiEncoding = "Auto detect ANSI encoding",
SubtitleLineMaximumLength = "Single line max. length",
AutoWrapWhileTyping = "Auto-wrap while typing",
SubtitleFont = "Subtitle font",
SubtitleFontSize = "Subtitle font size",
SubtitleFontColor = "Subtitle font color",

View File

@ -408,6 +408,11 @@
public string PreviewLinesModifiedX { get; set; }
}
public class Interjections
{
public string Title { get; set; }
}
public class Main
{
public MainMenu Menu { get; set; }
@ -661,6 +666,7 @@
{
public string Title { get; set; }
public string OpenVideo { get; set; }
public string ChooseAudioTrack { get; set; }
public string CloseVideo { get; set; }
public string ShowHideVideo { get; set; }
public string ShowHideWaveForm { get; set; }
@ -990,6 +996,7 @@
public string DefaultFileEncoding { get; set; }
public string AutoDetectAnsiEncoding { get; set; }
public string SubtitleLineMaximumLength { get; set; }
public string AutoWrapWhileTyping { get; set; }
public string SubtitleFont { get; set; }
public string SubtitleFontSize { get; set; }
public string SubtitleFontColor { get; set; }

View File

@ -88,7 +88,7 @@ namespace Nikse.SubtitleEdit.Logic
MusicSymbol = "♪";
MusicSymbolToReplace = "♪ ⶠ♪ âTª ã¢â™âª ?t×3 ?t¤3";
SpellCheckAutoChangeNames = true;
Interjections = "Ugh;Ughh;Hm;Hmm;Hmmm;Ahh;Whew;Phew;Gah;Oh;Ohh;Uh;Uhh;";
Interjections = "Ah;Ahh;Ahhh;Eh;Ehh;Ehhh;Hm;Hmm;Hmmm;Phew;Gah;Oh;Ohh;Ohhh;Ow;Oww;Owww;Ugh;Ughh;Uh;Uhh;Uhhh;Whew";
}
}
@ -228,6 +228,7 @@ namespace Nikse.SubtitleEdit.Logic
public bool StartInSourceView { get; set; }
public bool RemoveBlankLinesWhenOpening { get; set; }
public int SubtitleLineMaximumLength { get; set; }
public bool AutoWrapLineWhileTyping { get; set; }
public int SubtitleMaximumCharactersPerSeconds { get; set; }
public string SpellCheckLanguage { get; set; }
public string VideoPlayer { get; set; }
@ -277,6 +278,7 @@ namespace Nikse.SubtitleEdit.Logic
StartLoadLastFile = true;
StartRememberPositionAndSize = true;
SubtitleLineMaximumLength = 65;
AutoWrapLineWhileTyping = true;
SubtitleMaximumCharactersPerSeconds = 25;
SpellCheckLanguage = null;
VideoPlayer = string.Empty;
@ -598,10 +600,13 @@ namespace Nikse.SubtitleEdit.Logic
settings.General.StartInSourceView = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("RemoveBlankLinesWhenOpening");
if (subNode != null)
settings.General.RemoveBlankLinesWhenOpening = Convert.ToBoolean(subNode.InnerText);
settings.General.RemoveBlankLinesWhenOpening = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("SubtitleLineMaximumLength");
if (subNode != null)
settings.General.SubtitleLineMaximumLength = Convert.ToInt32(subNode.InnerText);
subNode = node.SelectSingleNode("AutoWrapLineWhileTyping");
if (subNode != null)
settings.General.AutoWrapLineWhileTyping = Convert.ToBoolean(subNode.InnerText);
subNode = node.SelectSingleNode("SubtitleMaximumCharactersPerSeconds");
if (subNode != null)
settings.General.SubtitleMaximumCharactersPerSeconds = Convert.ToInt32(subNode.InnerText);
@ -947,6 +952,7 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("StartInSourceView", settings.General.StartInSourceView.ToString());
textWriter.WriteElementString("RemoveBlankLinesWhenOpening", settings.General.RemoveBlankLinesWhenOpening.ToString());
textWriter.WriteElementString("SubtitleLineMaximumLength", settings.General.SubtitleLineMaximumLength.ToString());
textWriter.WriteElementString("AutoWrapLineWhileTyping", settings.General.AutoWrapLineWhileTyping.ToString());
textWriter.WriteElementString("SubtitleMaximumCharactersPerSeconds", settings.General.SubtitleMaximumCharactersPerSeconds.ToString());
textWriter.WriteElementString("SpellCheckLanguage", settings.General.SpellCheckLanguage);
textWriter.WriteElementString("VideoPlayer", settings.General.VideoPlayer);

View File

@ -0,0 +1,167 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
class FinalCutProXml : SubtitleFormat
{
public override string Extension
{
get { return ".xml"; }
}
public override string Name
{
get { return "Final Cut Pro Xml"; }
}
public override bool HasLineNumber
{
get { return false; }
}
public override bool IsTimeBased
{
get { return true; }
}
public override bool IsMine(List<string> lines, string fileName)
{
var subtitle = new Subtitle();
LoadSubtitle(subtitle, lines, fileName);
return subtitle.Paragraphs.Count > 0;
}
public override string ToText(Subtitle subtitle, string title)
{
string xmlStructure =
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + Environment.NewLine +
"<!DOCTYPE xmeml>" + Environment.NewLine +
"<xmeml version=\"3\">" + Environment.NewLine +
" <sequence id=\"Subtitles\">" + Environment.NewLine +
" <name>Subtitles</name>" + Environment.NewLine +
" <media>" + Environment.NewLine +
" <video />" + Environment.NewLine +
" </media>" + Environment.NewLine +
" </sequence>" + Environment.NewLine +
"</xmeml>";
string xmlTrackStructure =
"<generatoritem>" + Environment.NewLine +
" <name>Text</name>" + Environment.NewLine +
" <rate>" + Environment.NewLine +
" <ntsc>TRUE</ntsc>" + Environment.NewLine +
" <timebase>30</timebase>" + Environment.NewLine +
" </rate>" + Environment.NewLine +
" <start></start>" + Environment.NewLine + // start frame?
" <end></end>" + Environment.NewLine + // end frame?
" <enabled>TRUE</enabled>" + Environment.NewLine +
" <anamorphic>FALSE</anamorphic>" + Environment.NewLine +
" <alphatype>black</alphatype>" + Environment.NewLine +
" <effect id=\"subtitle\">" + Environment.NewLine +
" <name>Text</name>" + Environment.NewLine +
" <effectid>Text</effectid>" + Environment.NewLine +
" <effectcategory>Text</effectcategory>" + Environment.NewLine +
" <effecttype>generator</effecttype>" + Environment.NewLine +
" <mediatype>video</mediatype>" + Environment.NewLine +
" <parameter>" + Environment.NewLine +
" <parameterid>str</parameterid>" + Environment.NewLine +
" <name>Text</name>" + Environment.NewLine +
" <value />" + Environment.NewLine + // TEXT GOES HERE
" </parameter>" + Environment.NewLine +
" </effect>" + Environment.NewLine +
"</generatoritem>";
XmlDocument xml = new XmlDocument();
xml.LoadXml(xmlStructure);
XmlNode videoNode = xml.DocumentElement.SelectSingleNode("sequence/media/video");
foreach (Paragraph p in subtitle.Paragraphs)
{
XmlNode track = xml.CreateElement("track");
track.InnerXml = xmlTrackStructure;
const int frameRate = 30;
XmlNode start = track.SelectSingleNode("generatoritem/start");
start.InnerText = (p.StartTime.TotalSeconds*frameRate).ToString();
XmlNode end = track.SelectSingleNode("generatoritem/end");
end.InnerText = (p.EndTime.TotalSeconds * frameRate).ToString();
XmlNode text = track.SelectSingleNode("generatoritem/effect/parameter/value");
text.InnerText = Utilities.RemoveHtmlTags(p.Text);
videoNode.AppendChild(track);
}
MemoryStream ms = new MemoryStream();
XmlTextWriter writer = new XmlTextWriter(ms, Encoding.UTF8);
writer.Formatting = Formatting.Indented;
xml.Save(writer);
return Encoding.UTF8.GetString(ms.ToArray()).Trim();
}
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
{
const int frameRate = 30;
_errorCount = 0;
StringBuilder sb = new StringBuilder();
lines.ForEach(line => sb.AppendLine(line));
XmlDocument xml = new XmlDocument();
try
{
xml.LoadXml(sb.ToString());
foreach (XmlNode node in xml.SelectNodes("xmeml/sequence/media/video/track"))
{
try
{
foreach (XmlNode generatorItemNode in node.SelectNodes("generatoritem"))
{
int startFrame = 0;
int endFrame = 0;
XmlNode startNode = generatorItemNode.SelectSingleNode("start");
if (startNode != null)
startFrame = int.Parse(startNode.InnerText);
XmlNode endNode = generatorItemNode.SelectSingleNode("end");
if (endNode != null)
endFrame = int.Parse(endNode.InnerText);
string text = string.Empty;
foreach (XmlNode parameterNode in generatorItemNode.SelectNodes("effect/parameter[parameterid='str']"))
{
XmlNode valueNode = parameterNode.SelectSingleNode("value");
if (valueNode != null)
text += valueNode.InnerText;
}
if (text.Length > 0)
{
subtitle.Paragraphs.Add(new Paragraph(text, Convert.ToDouble((startFrame / frameRate) *1000), Convert.ToDouble((endFrame / frameRate) * 1000)));
}
}
}
catch (Exception ex)
{
_errorCount++;
}
}
subtitle.Renumber(1);
}
catch
{
_errorCount = 1;
return;
}
}
}
}

View File

@ -20,6 +20,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
new DvdStudioPro(),
new DvdSubtitle(),
// new Ebu(),
new FinalCutProXml(),
new MicroDvd(),
new MPlayer2(),
new OpenDvt(),

View File

@ -511,6 +511,7 @@
<Compile Include="Logic\StripableText.cs" />
<Compile Include="Logic\SubtitleFormats\AdobeEncore.cs" />
<Compile Include="Logic\SubtitleFormats\AdobeEncoreTabs.cs" />
<Compile Include="Logic\SubtitleFormats\FinalCutProXml.cs" />
<Compile Include="Logic\SubtitleFormats\PinnacleImpression.cs" />
<Compile Include="Logic\SubtitleFormats\QuickTimeText.cs" />
<Compile Include="Logic\SubtitleFormats\RealTime.cs" />