mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Add taskbar progress bar for audio to text - thx lambdacore12 :)
This commit is contained in:
parent
c2bf710c07
commit
d89f4ac2e2
@ -23,6 +23,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
Changelog.txt = Changelog.txt
|
||||
LICENSE.txt = LICENSE.txt
|
||||
README.md = README.md
|
||||
installer\Subtitle_Edit_installer.iss = installer\Subtitle_Edit_installer.iss
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibSE", "src\libse\LibSE.csproj", "{D6F64CD3-C3EA-4B36-B575-9B3B8A3CA13F}"
|
||||
|
@ -190,6 +190,8 @@ COPY /Y /V "NCalc.dll" "temp_zip\"
|
||||
COPY /Y /V "..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\"
|
||||
COPY /Y /V "System.Net.Http.Extensions.dll" "temp_zip\"
|
||||
COPY /Y /V "Newtonsoft.Json.dll" "temp_zip\"
|
||||
COPY /Y /V "Xceed.Document.NET.dll" "temp_zip\"
|
||||
COPY /Y /V "Xceed.Words.NET.dll" "temp_zip\"
|
||||
COPY /Y /V "System.Net.Http.Primitives.dll" "temp_zip\"
|
||||
COPY /Y /V "SubtitleEdit.exe" "temp_zip\"
|
||||
COPY /Y /V "Languages\*.xml" "temp_zip\Languages\"
|
||||
|
@ -178,6 +178,8 @@ COPY /Y /V "NCalc.dll" "temp_zip\"
|
||||
COPY /Y /V "..\..\DLLs\Interop.QuartzTypeLib.dll" "temp_zip\"
|
||||
COPY /Y /V "System.Net.Http.Extensions.dll" "temp_zip\"
|
||||
COPY /Y /V "Newtonsoft.Json.dll" "temp_zip\"
|
||||
COPY /Y /V "Xceed.Document.NET.dll" "temp_zip\"
|
||||
COPY /Y /V "Xceed.Words.NET.dll" "temp_zip\"
|
||||
COPY /Y /V "System.Net.Http.Primitives.dll" "temp_zip\"
|
||||
COPY /Y /V "SubtitleEdit.exe" "temp_zip\"
|
||||
COPY /Y /V "Languages\*.xml" "temp_zip\Languages\"
|
||||
|
@ -308,6 +308,8 @@ Source: {#bindir}\Vosk.dll; DestDir: {app};
|
||||
Source: {#bindir}\NCalc.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: ..\src\ui\DLLs\Interop.QuartzTypeLib.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: {#bindir}\Newtonsoft.Json.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: {#bindir}\Xceed.Document.NET.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: {#bindir}\Xceed.Words.NET.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: {#bindir}\System.Net.Http.Extensions.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: {#bindir}\System.Net.Http.Primitives.dll; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
Source: ..\Changelog.txt; DestDir: {app}; Flags: ignoreversion; Components: main
|
||||
@ -347,6 +349,8 @@ Type: files; Name: {app}\Vosk.dll; Check: IsU
|
||||
Type: files; Name: {app}\NCalc.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Interop.QuartzTypeLib.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Newtonsoft.Json.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Xceed.Document.NET.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\Xceed.Words.NET.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\System.Net.Http.Extensions.dll; Check: IsUpgrade()
|
||||
Type: files; Name: {app}\System.Net.Http.Primitives.dll; Check: IsUpgrade()
|
||||
|
||||
|
@ -26,15 +26,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private long _bytesWavTotal;
|
||||
private long _bytesWavRead;
|
||||
private readonly List<string> _filesToDelete;
|
||||
private readonly Form _parentForm;
|
||||
public Subtitle TranscribedSubtitle { get; private set; }
|
||||
|
||||
public AudioToText(string videoFileName)
|
||||
public AudioToText(string videoFileName, Form parentForm)
|
||||
{
|
||||
UiUtil.PreInitialize(this);
|
||||
InitializeComponent();
|
||||
UiUtil.FixFonts(this);
|
||||
UiUtil.FixLargeFonts(this, buttonGenerate);
|
||||
_videoFileName = videoFileName;
|
||||
_parentForm = parentForm;
|
||||
|
||||
Text = LanguageSettings.Current.AudioToText.Title;
|
||||
labelInfo.Text = LanguageSettings.Current.AudioToText.Info;
|
||||
@ -117,6 +119,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
GenerateBatch();
|
||||
TaskbarList.SetProgressState(_parentForm.Handle, TaskbarButtonProgressFlags.NoProgress);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -170,6 +173,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var transcript = TranscribeViaVosk(waveFileName, modelFileName);
|
||||
if (_cancel)
|
||||
{
|
||||
TaskbarList.SetProgressState(_parentForm.Handle, TaskbarButtonProgressFlags.NoProgress);
|
||||
if (!_batchMode)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
@ -186,10 +190,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
TranscribedSubtitle = postProcessor.Generate(transcript, checkBoxUsePostProcessing.Checked);
|
||||
|
||||
SaveToSourceFolder(videoFileName);
|
||||
TaskbarList.SetProgressValue(_parentForm.Handle, _batchFileNumber, listViewInputFiles.Items.Count);
|
||||
}
|
||||
|
||||
progressBar1.Visible = false;
|
||||
labelTime.Text = string.Empty;
|
||||
|
||||
TaskbarList.StartBlink(_parentForm, 10, 1, 2);
|
||||
MessageBox.Show(string.Format(LanguageSettings.Current.AudioToText.XFilesSavedToVideoSourceFolder, listViewInputFiles.Items.Count));
|
||||
groupBoxInputFiles.Enabled = true;
|
||||
buttonGenerate.Enabled = true;
|
||||
@ -249,6 +256,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
labelProgress.Text = string.Format(LanguageSettings.Current.AudioToText.TranscribingXOfY, _batchFileNumber, listViewInputFiles.Items.Count);
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskbarList.SetProgressValue(_parentForm.Handle, 1, 100);
|
||||
}
|
||||
|
||||
labelProgress.Refresh();
|
||||
Application.DoEvents();
|
||||
@ -278,11 +289,22 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
textBoxLog.AppendText(res.RemoveChar('\r', '\n'));
|
||||
}
|
||||
|
||||
if (!_batchMode)
|
||||
{
|
||||
TaskbarList.SetProgressValue(_parentForm.Handle, Math.Max(1, progressBar1.Value), progressBar1.Maximum);
|
||||
}
|
||||
|
||||
if (_cancel)
|
||||
{
|
||||
TaskbarList.SetProgressState(_parentForm.Handle, TaskbarButtonProgressFlags.NoProgress);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (!_batchMode)
|
||||
{
|
||||
TaskbarList.StartBlink(_parentForm, 10, 1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
var finalResult = rec.FinalResult();
|
||||
|
514
src/ui/Forms/Main.Designer.cs
generated
514
src/ui/Forms/Main.Designer.cs
generated
@ -40,9 +40,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
|
||||
Nikse.SubtitleEdit.Core.Common.TimeCode timeCode3 = new Nikse.SubtitleEdit.Core.Common.TimeCode();
|
||||
Nikse.SubtitleEdit.Core.Common.TimeCode timeCode1 = new Nikse.SubtitleEdit.Core.Common.TimeCode();
|
||||
Nikse.SubtitleEdit.Core.Common.TimeCode timeCode2 = new Nikse.SubtitleEdit.Core.Common.TimeCode();
|
||||
Nikse.SubtitleEdit.Core.Common.TimeCode timeCode3 = new Nikse.SubtitleEdit.Core.Common.TimeCode();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.labelStatus = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.toolStripSelected = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
@ -346,6 +346,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
|
||||
this.groupBoxVideo = new System.Windows.Forms.GroupBox();
|
||||
this.labelNextWord = new System.Windows.Forms.Label();
|
||||
this.audioVisualizer = new Nikse.SubtitleEdit.Controls.AudioVisualizer();
|
||||
this.checkBoxSyncListViewWithVideoWhilePlaying = new System.Windows.Forms.CheckBox();
|
||||
this.labelVideoInfo = new System.Windows.Forms.Label();
|
||||
this.trackBarWaveformPosition = new System.Windows.Forms.TrackBar();
|
||||
@ -381,6 +382,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.buttonPlayCurrent = new System.Windows.Forms.Button();
|
||||
this.buttonPlayNext = new System.Windows.Forms.Button();
|
||||
this.tabPageCreate = new System.Windows.Forms.TabPage();
|
||||
this.timeUpDownVideoPosition = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.buttonGotoSub = new System.Windows.Forms.Button();
|
||||
this.buttonBeforeText = new System.Windows.Forms.Button();
|
||||
this.buttonSetEnd = new System.Windows.Forms.Button();
|
||||
@ -398,6 +400,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelVideoPosition = new System.Windows.Forms.Label();
|
||||
this.buttonSecBack1 = new System.Windows.Forms.Button();
|
||||
this.tabPageAdjust = new System.Windows.Forms.TabPage();
|
||||
this.timeUpDownVideoPositionAdjust = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.buttonAdjustSetEndTime = new System.Windows.Forms.Button();
|
||||
this.buttonSetEndAndGoToNext = new System.Windows.Forms.Button();
|
||||
this.buttonSetStartAndOffsetRest = new System.Windows.Forms.Button();
|
||||
@ -450,6 +453,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.splitContainerMain = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainerListViewAndText = new System.Windows.Forms.SplitContainer();
|
||||
this.SubtitleListview1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
|
||||
this.imageListBookmarks = new System.Windows.Forms.ImageList(this.components);
|
||||
this.groupBoxEdit = new System.Windows.Forms.GroupBox();
|
||||
this.labelOriginalSingleLinePixels = new System.Windows.Forms.Label();
|
||||
@ -467,6 +471,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelTextOriginalLineLengths = new System.Windows.Forms.Label();
|
||||
this.labelOriginalText = new System.Windows.Forms.Label();
|
||||
this.labelText = new System.Windows.Forms.Label();
|
||||
this.textBoxListViewTextOriginal = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.contextMenuStripTextBoxListView = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toolStripSeparatorSpellCheckSuggestions = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripMenuItemSpellCheckSkipOnce = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -521,10 +526,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelTextLineTotal = new System.Windows.Forms.Label();
|
||||
this.labelCharactersPerSecond = new System.Windows.Forms.Label();
|
||||
this.buttonUnBreak = new System.Windows.Forms.Button();
|
||||
this.timeUpDownStartTime = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.numericUpDownDuration = new System.Windows.Forms.NumericUpDown();
|
||||
this.buttonPrevious = new System.Windows.Forms.Button();
|
||||
this.buttonNext = new System.Windows.Forms.Button();
|
||||
this.labelStartTime = new System.Windows.Forms.Label();
|
||||
this.textBoxListViewText = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.labelDuration = new System.Windows.Forms.Label();
|
||||
this.labelAutoDuration = new System.Windows.Forms.Label();
|
||||
this.textBoxSource = new System.Windows.Forms.TextBox();
|
||||
@ -547,6 +554,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.startOfLefttorightOverrideLROToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.startOfRighttoleftOverrideRLOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.panelVideoPlayer = new System.Windows.Forms.Panel();
|
||||
this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
|
||||
this.contextMenuStripEmpty = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.insertLineToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.aSSStylesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@ -555,14 +563,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.timerOriginalTextUndo = new System.Windows.Forms.Timer(this.components);
|
||||
this.contextMenuStripShowVideoControls = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.toolStripMenuItemShowVideoControls = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.SubtitleListview1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
|
||||
this.textBoxListViewTextOriginal = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.timeUpDownStartTime = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.textBoxListViewText = new Nikse.SubtitleEdit.Controls.SETextBox();
|
||||
this.mediaPlayer = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
|
||||
this.audioVisualizer = new Nikse.SubtitleEdit.Controls.AudioVisualizer();
|
||||
this.timeUpDownVideoPosition = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.timeUpDownVideoPositionAdjust = new Nikse.SubtitleEdit.Controls.TimeUpDown();
|
||||
this.exporImportTofromWordToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.toolStrip1.SuspendLayout();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
@ -2406,7 +2407,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.autotranslateViaCopypasteToolStripMenuItem,
|
||||
this.toolStripSeparator26,
|
||||
this.mergeSentencesToolStripMenuItem,
|
||||
this.breaksplitLongLinesToolStripMenuItem});
|
||||
this.breaksplitLongLinesToolStripMenuItem,
|
||||
this.exporImportTofromWordToolStripMenuItem});
|
||||
this.toolStripMenuItemAutoTranslate.Name = "toolStripMenuItemAutoTranslate";
|
||||
this.toolStripMenuItemAutoTranslate.Size = new System.Drawing.Size(94, 20);
|
||||
this.toolStripMenuItemAutoTranslate.Text = "Auto-translate";
|
||||
@ -2597,7 +2599,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemSelectedLines,
|
||||
this.toolStripMenuItemGoogleMicrosoftTranslateSelLine});
|
||||
this.contextMenuStripListView.Name = "contextMenuStripListView";
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 798);
|
||||
this.contextMenuStripListView.Size = new System.Drawing.Size(285, 776);
|
||||
this.contextMenuStripListView.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.MenuClosed);
|
||||
this.contextMenuStripListView.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListViewOpening);
|
||||
this.contextMenuStripListView.Opened += new System.EventHandler(this.MenuOpened);
|
||||
@ -3164,6 +3166,54 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelNextWord.Text = "Next: xxx";
|
||||
this.labelNextWord.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// audioVisualizer
|
||||
//
|
||||
this.audioVisualizer.AllowDrop = true;
|
||||
this.audioVisualizer.AllowNewSelection = true;
|
||||
this.audioVisualizer.AllowOverlap = false;
|
||||
this.audioVisualizer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.audioVisualizer.BackColor = System.Drawing.Color.Black;
|
||||
this.audioVisualizer.BackgroundColor = System.Drawing.Color.Black;
|
||||
this.audioVisualizer.Chapters = null;
|
||||
this.audioVisualizer.ChaptersColor = System.Drawing.Color.Empty;
|
||||
this.audioVisualizer.ClosenessForBorderSelection = 15;
|
||||
this.audioVisualizer.Color = System.Drawing.Color.GreenYellow;
|
||||
this.audioVisualizer.CursorColor = System.Drawing.Color.Empty;
|
||||
this.audioVisualizer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.audioVisualizer.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(18)))));
|
||||
this.audioVisualizer.InsertAtVideoPositionShortcut = System.Windows.Forms.Keys.Insert;
|
||||
this.audioVisualizer.Location = new System.Drawing.Point(472, 32);
|
||||
this.audioVisualizer.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.audioVisualizer.MouseWheelScrollUpIsForward = true;
|
||||
this.audioVisualizer.Move100MsLeft = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.Move100MsRight = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.MoveOneSecondLeft = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.MoveOneSecondRight = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.Name = "audioVisualizer";
|
||||
this.audioVisualizer.NewSelectionParagraph = null;
|
||||
this.audioVisualizer.ParagraphColor = System.Drawing.Color.LimeGreen;
|
||||
this.audioVisualizer.SelectedColor = System.Drawing.Color.Red;
|
||||
this.audioVisualizer.ShotChanges = ((System.Collections.Generic.List<double>)(resources.GetObject("audioVisualizer.ShotChanges")));
|
||||
this.audioVisualizer.ShowGridLines = true;
|
||||
this.audioVisualizer.ShowSpectrogram = false;
|
||||
this.audioVisualizer.ShowWaveform = true;
|
||||
this.audioVisualizer.Size = new System.Drawing.Size(499, 229);
|
||||
this.audioVisualizer.StartPositionSeconds = 0D;
|
||||
this.audioVisualizer.TabIndex = 6;
|
||||
this.audioVisualizer.TextBold = true;
|
||||
this.audioVisualizer.TextColor = System.Drawing.Color.Gray;
|
||||
this.audioVisualizer.TextSize = 9F;
|
||||
this.audioVisualizer.VerticalZoomFactor = 1D;
|
||||
this.audioVisualizer.WaveformNotLoadedText = "Click to add waveform";
|
||||
this.audioVisualizer.WavePeaks = null;
|
||||
this.audioVisualizer.ZoomFactor = 1D;
|
||||
this.audioVisualizer.Click += new System.EventHandler(this.AudioWaveform_Click);
|
||||
this.audioVisualizer.DragDrop += new System.Windows.Forms.DragEventHandler(this.AudioWaveformDragDrop);
|
||||
this.audioVisualizer.DragEnter += new System.Windows.Forms.DragEventHandler(this.AudioWaveformDragEnter);
|
||||
this.audioVisualizer.MouseEnter += new System.EventHandler(this.audioVisualizer_MouseEnter);
|
||||
//
|
||||
// checkBoxSyncListViewWithVideoWhilePlaying
|
||||
//
|
||||
this.checkBoxSyncListViewWithVideoWhilePlaying.AutoSize = true;
|
||||
@ -3588,6 +3638,26 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.tabPageCreate.Text = "Create";
|
||||
this.tabPageCreate.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// timeUpDownVideoPosition
|
||||
//
|
||||
this.timeUpDownVideoPosition.AutoSize = true;
|
||||
this.timeUpDownVideoPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownVideoPosition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownVideoPosition.Location = new System.Drawing.Point(90, 190);
|
||||
this.timeUpDownVideoPosition.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownVideoPosition.Name = "timeUpDownVideoPosition";
|
||||
this.timeUpDownVideoPosition.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownVideoPosition.TabIndex = 12;
|
||||
timeCode1.Hours = 0;
|
||||
timeCode1.Milliseconds = 0;
|
||||
timeCode1.Minutes = 0;
|
||||
timeCode1.Seconds = 0;
|
||||
timeCode1.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode1.TotalMilliseconds = 0D;
|
||||
timeCode1.TotalSeconds = 0D;
|
||||
this.timeUpDownVideoPosition.TimeCode = timeCode1;
|
||||
this.timeUpDownVideoPosition.UseVideoOffset = false;
|
||||
//
|
||||
// buttonGotoSub
|
||||
//
|
||||
this.buttonGotoSub.Location = new System.Drawing.Point(6, 58);
|
||||
@ -3808,6 +3878,26 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.tabPageAdjust.Text = "Adjust";
|
||||
this.tabPageAdjust.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// timeUpDownVideoPositionAdjust
|
||||
//
|
||||
this.timeUpDownVideoPositionAdjust.AutoSize = true;
|
||||
this.timeUpDownVideoPositionAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownVideoPositionAdjust.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownVideoPositionAdjust.Location = new System.Drawing.Point(90, 215);
|
||||
this.timeUpDownVideoPositionAdjust.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownVideoPositionAdjust.Name = "timeUpDownVideoPositionAdjust";
|
||||
this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownVideoPositionAdjust.TabIndex = 13;
|
||||
timeCode2.Hours = 0;
|
||||
timeCode2.Milliseconds = 0;
|
||||
timeCode2.Minutes = 0;
|
||||
timeCode2.Seconds = 0;
|
||||
timeCode2.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode2.TotalMilliseconds = 0D;
|
||||
timeCode2.TotalSeconds = 0D;
|
||||
this.timeUpDownVideoPositionAdjust.TimeCode = timeCode2;
|
||||
this.timeUpDownVideoPositionAdjust.UseVideoOffset = false;
|
||||
//
|
||||
// buttonAdjustSetEndTime
|
||||
//
|
||||
this.buttonAdjustSetEndTime.Location = new System.Drawing.Point(6, 84);
|
||||
@ -4308,6 +4398,39 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.splitContainerListViewAndText.TabIndex = 2;
|
||||
this.splitContainerListViewAndText.VisibleChanged += new System.EventHandler(this.ListViewVisibleChanged);
|
||||
//
|
||||
// SubtitleListview1
|
||||
//
|
||||
this.SubtitleListview1.AllowColumnReorder = true;
|
||||
this.SubtitleListview1.AllowDrop = true;
|
||||
this.SubtitleListview1.ContextMenuStrip = this.contextMenuStripListView;
|
||||
this.SubtitleListview1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.SubtitleListview1.FirstVisibleIndex = -1;
|
||||
this.SubtitleListview1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.SubtitleListview1.FullRowSelect = true;
|
||||
this.SubtitleListview1.GridLines = true;
|
||||
this.SubtitleListview1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||
this.SubtitleListview1.HideSelection = false;
|
||||
this.SubtitleListview1.Location = new System.Drawing.Point(0, 0);
|
||||
this.SubtitleListview1.Name = "SubtitleListview1";
|
||||
this.SubtitleListview1.OwnerDraw = true;
|
||||
this.SubtitleListview1.Size = new System.Drawing.Size(740, 105);
|
||||
this.SubtitleListview1.StateImageList = this.imageListBookmarks;
|
||||
this.SubtitleListview1.SubtitleFontBold = false;
|
||||
this.SubtitleListview1.SubtitleFontName = "Tahoma";
|
||||
this.SubtitleListview1.SubtitleFontSize = 8;
|
||||
this.SubtitleListview1.TabIndex = 0;
|
||||
this.SubtitleListview1.UseCompatibleStateImageBehavior = false;
|
||||
this.SubtitleListview1.UseSyntaxColoring = true;
|
||||
this.SubtitleListview1.View = System.Windows.Forms.View.Details;
|
||||
this.SubtitleListview1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListview1_SelectedIndexChanged);
|
||||
this.SubtitleListview1.DragDrop += new System.Windows.Forms.DragEventHandler(this.SubtitleListview1_DragDrop);
|
||||
this.SubtitleListview1.DragEnter += new System.Windows.Forms.DragEventHandler(this.SubtitleListview1_DragEnter);
|
||||
this.SubtitleListview1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SubtitleListview1KeyDown);
|
||||
this.SubtitleListview1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseDoubleClick);
|
||||
this.SubtitleListview1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseDown);
|
||||
this.SubtitleListview1.MouseEnter += new System.EventHandler(this.SubtitleListview1_MouseEnter);
|
||||
this.SubtitleListview1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseUp);
|
||||
//
|
||||
// imageListBookmarks
|
||||
//
|
||||
this.imageListBookmarks.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
|
||||
@ -4504,6 +4627,43 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelText.TabIndex = 5;
|
||||
this.labelText.Text = "Text";
|
||||
//
|
||||
// textBoxListViewTextOriginal
|
||||
//
|
||||
this.textBoxListViewTextOriginal.AllowDrop = true;
|
||||
this.textBoxListViewTextOriginal.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBoxListViewTextOriginal.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.textBoxListViewTextOriginal.ContextMenuStrip = this.contextMenuStripTextBoxListView;
|
||||
this.textBoxListViewTextOriginal.CurrentLanguage = "";
|
||||
this.textBoxListViewTextOriginal.CurrentLineIndex = 0;
|
||||
this.textBoxListViewTextOriginal.Enabled = false;
|
||||
this.textBoxListViewTextOriginal.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewTextOriginal.HideSelection = false;
|
||||
this.textBoxListViewTextOriginal.IsDictionaryDownloaded = true;
|
||||
this.textBoxListViewTextOriginal.IsSpellCheckerInitialized = false;
|
||||
this.textBoxListViewTextOriginal.IsSpellCheckRequested = false;
|
||||
this.textBoxListViewTextOriginal.IsWrongWord = false;
|
||||
this.textBoxListViewTextOriginal.LanguageChanged = false;
|
||||
this.textBoxListViewTextOriginal.Location = new System.Drawing.Point(946, 28);
|
||||
this.textBoxListViewTextOriginal.Multiline = true;
|
||||
this.textBoxListViewTextOriginal.Name = "textBoxListViewTextOriginal";
|
||||
this.textBoxListViewTextOriginal.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxListViewTextOriginal.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Both;
|
||||
this.textBoxListViewTextOriginal.SelectedText = "";
|
||||
this.textBoxListViewTextOriginal.SelectionLength = 0;
|
||||
this.textBoxListViewTextOriginal.SelectionStart = 0;
|
||||
this.textBoxListViewTextOriginal.Size = new System.Drawing.Size(16, 84);
|
||||
this.textBoxListViewTextOriginal.TabIndex = 33;
|
||||
this.textBoxListViewTextOriginal.TextBoxFont = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewTextOriginal.Visible = false;
|
||||
this.textBoxListViewTextOriginal.TextChanged += new System.EventHandler(this.textBoxListViewTextOriginal_TextChanged);
|
||||
this.textBoxListViewTextOriginal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextOriginalKeyDown);
|
||||
this.textBoxListViewTextOriginal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextOriginalMouseClick);
|
||||
this.textBoxListViewTextOriginal.Enter += new System.EventHandler(this.TextBoxListViewTextOriginalEnter);
|
||||
this.textBoxListViewTextOriginal.KeyUp += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextOriginalKeyUp);
|
||||
this.textBoxListViewTextOriginal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextOriginalMouseMove);
|
||||
//
|
||||
// contextMenuStripTextBoxListView
|
||||
//
|
||||
this.contextMenuStripTextBoxListView.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@ -4945,6 +5105,26 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.buttonUnBreak.UseVisualStyleBackColor = true;
|
||||
this.buttonUnBreak.Click += new System.EventHandler(this.ButtonUnBreakClick);
|
||||
//
|
||||
// timeUpDownStartTime
|
||||
//
|
||||
this.timeUpDownStartTime.AutoSize = true;
|
||||
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownStartTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 26);
|
||||
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
||||
this.timeUpDownStartTime.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownStartTime.TabIndex = 0;
|
||||
timeCode3.Hours = 0;
|
||||
timeCode3.Milliseconds = 0;
|
||||
timeCode3.Minutes = 0;
|
||||
timeCode3.Seconds = 0;
|
||||
timeCode3.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode3.TotalMilliseconds = 0D;
|
||||
timeCode3.TotalSeconds = 0D;
|
||||
this.timeUpDownStartTime.TimeCode = timeCode3;
|
||||
this.timeUpDownStartTime.UseVideoOffset = false;
|
||||
//
|
||||
// numericUpDownDuration
|
||||
//
|
||||
this.numericUpDownDuration.DecimalPlaces = 3;
|
||||
@ -4998,6 +5178,43 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.labelStartTime.TabIndex = 3;
|
||||
this.labelStartTime.Text = "Start time";
|
||||
//
|
||||
// textBoxListViewText
|
||||
//
|
||||
this.textBoxListViewText.AllowDrop = true;
|
||||
this.textBoxListViewText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBoxListViewText.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.textBoxListViewText.ContextMenuStrip = this.contextMenuStripTextBoxListView;
|
||||
this.textBoxListViewText.CurrentLanguage = "";
|
||||
this.textBoxListViewText.CurrentLineIndex = 0;
|
||||
this.textBoxListViewText.Enabled = false;
|
||||
this.textBoxListViewText.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewText.HideSelection = false;
|
||||
this.textBoxListViewText.IsDictionaryDownloaded = true;
|
||||
this.textBoxListViewText.IsSpellCheckerInitialized = false;
|
||||
this.textBoxListViewText.IsSpellCheckRequested = false;
|
||||
this.textBoxListViewText.IsWrongWord = false;
|
||||
this.textBoxListViewText.LanguageChanged = false;
|
||||
this.textBoxListViewText.Location = new System.Drawing.Point(236, 28);
|
||||
this.textBoxListViewText.Multiline = true;
|
||||
this.textBoxListViewText.Name = "textBoxListViewText";
|
||||
this.textBoxListViewText.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxListViewText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Both;
|
||||
this.textBoxListViewText.SelectedText = "";
|
||||
this.textBoxListViewText.SelectionLength = 0;
|
||||
this.textBoxListViewText.SelectionStart = 0;
|
||||
this.textBoxListViewText.Size = new System.Drawing.Size(378, 84);
|
||||
this.textBoxListViewText.TabIndex = 5;
|
||||
this.textBoxListViewText.TextBoxFont = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewText.TextChanged += new System.EventHandler(this.TextBoxListViewTextTextChanged);
|
||||
this.textBoxListViewText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextKeyDown);
|
||||
this.textBoxListViewText.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextMouseClick);
|
||||
this.textBoxListViewText.Enter += new System.EventHandler(this.TextBoxListViewTextEnter);
|
||||
this.textBoxListViewText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBoxListViewText_KeyUp);
|
||||
this.textBoxListViewText.Leave += new System.EventHandler(this.textBoxListViewText_Leave);
|
||||
this.textBoxListViewText.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBoxListViewText_MouseMove);
|
||||
//
|
||||
// labelDuration
|
||||
//
|
||||
this.labelDuration.AutoSize = true;
|
||||
@ -5192,6 +5409,34 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.panelVideoPlayer.Size = new System.Drawing.Size(220, 246);
|
||||
this.panelVideoPlayer.TabIndex = 5;
|
||||
//
|
||||
// mediaPlayer
|
||||
//
|
||||
this.mediaPlayer.AllowDrop = true;
|
||||
this.mediaPlayer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.mediaPlayer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
|
||||
this.mediaPlayer.Chapters = null;
|
||||
this.mediaPlayer.CurrentPosition = 0D;
|
||||
this.mediaPlayer.FontSizeFactor = 1F;
|
||||
this.mediaPlayer.LastParagraph = null;
|
||||
this.mediaPlayer.Location = new System.Drawing.Point(0, 0);
|
||||
this.mediaPlayer.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.mediaPlayer.Name = "mediaPlayer";
|
||||
this.mediaPlayer.ShowFullscreenButton = true;
|
||||
this.mediaPlayer.ShowMuteButton = true;
|
||||
this.mediaPlayer.ShowStopButton = true;
|
||||
this.mediaPlayer.Size = new System.Drawing.Size(219, 246);
|
||||
this.mediaPlayer.SubtitleText = "";
|
||||
this.mediaPlayer.TabIndex = 5;
|
||||
this.mediaPlayer.TextRightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.mediaPlayer.VideoHeight = 0;
|
||||
this.mediaPlayer.VideoPlayer = null;
|
||||
this.mediaPlayer.VideoWidth = 0;
|
||||
this.mediaPlayer.Volume = 0D;
|
||||
this.mediaPlayer.DragDrop += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragDrop);
|
||||
this.mediaPlayer.DragEnter += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragEnter);
|
||||
//
|
||||
// contextMenuStripEmpty
|
||||
//
|
||||
this.contextMenuStripEmpty.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@ -5247,248 +5492,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
this.toolStripMenuItemShowVideoControls.Text = "Show video controls";
|
||||
this.toolStripMenuItemShowVideoControls.Click += new System.EventHandler(this.toolStripMenuItemShowVideoControls_Click);
|
||||
//
|
||||
// SubtitleListview1
|
||||
// exporImportTofromWordToolStripMenuItem
|
||||
//
|
||||
this.SubtitleListview1.AllowColumnReorder = true;
|
||||
this.SubtitleListview1.AllowDrop = true;
|
||||
this.SubtitleListview1.ContextMenuStrip = this.contextMenuStripListView;
|
||||
this.SubtitleListview1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.SubtitleListview1.FirstVisibleIndex = -1;
|
||||
this.SubtitleListview1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.SubtitleListview1.FullRowSelect = true;
|
||||
this.SubtitleListview1.GridLines = true;
|
||||
this.SubtitleListview1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||
this.SubtitleListview1.HideSelection = false;
|
||||
this.SubtitleListview1.Location = new System.Drawing.Point(0, 0);
|
||||
this.SubtitleListview1.Name = "SubtitleListview1";
|
||||
this.SubtitleListview1.OwnerDraw = true;
|
||||
this.SubtitleListview1.Size = new System.Drawing.Size(740, 105);
|
||||
this.SubtitleListview1.StateImageList = this.imageListBookmarks;
|
||||
this.SubtitleListview1.SubtitleFontBold = false;
|
||||
this.SubtitleListview1.SubtitleFontName = "Tahoma";
|
||||
this.SubtitleListview1.SubtitleFontSize = 8;
|
||||
this.SubtitleListview1.TabIndex = 0;
|
||||
this.SubtitleListview1.UseCompatibleStateImageBehavior = false;
|
||||
this.SubtitleListview1.UseSyntaxColoring = true;
|
||||
this.SubtitleListview1.View = System.Windows.Forms.View.Details;
|
||||
this.SubtitleListview1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListview1_SelectedIndexChanged);
|
||||
this.SubtitleListview1.DragDrop += new System.Windows.Forms.DragEventHandler(this.SubtitleListview1_DragDrop);
|
||||
this.SubtitleListview1.DragEnter += new System.Windows.Forms.DragEventHandler(this.SubtitleListview1_DragEnter);
|
||||
this.SubtitleListview1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.SubtitleListview1KeyDown);
|
||||
this.SubtitleListview1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseDoubleClick);
|
||||
this.SubtitleListview1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseDown);
|
||||
this.SubtitleListview1.MouseEnter += new System.EventHandler(this.SubtitleListview1_MouseEnter);
|
||||
this.SubtitleListview1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.SubtitleListview1_MouseUp);
|
||||
//
|
||||
// textBoxListViewTextOriginal
|
||||
//
|
||||
this.textBoxListViewTextOriginal.AllowDrop = true;
|
||||
this.textBoxListViewTextOriginal.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBoxListViewTextOriginal.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.textBoxListViewTextOriginal.ContextMenuStrip = this.contextMenuStripTextBoxListView;
|
||||
this.textBoxListViewTextOriginal.CurrentLanguage = "";
|
||||
this.textBoxListViewTextOriginal.CurrentLineIndex = 0;
|
||||
this.textBoxListViewTextOriginal.Enabled = false;
|
||||
this.textBoxListViewTextOriginal.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewTextOriginal.HideSelection = false;
|
||||
this.textBoxListViewTextOriginal.IsDictionaryDownloaded = true;
|
||||
this.textBoxListViewTextOriginal.IsSpellCheckerInitialized = false;
|
||||
this.textBoxListViewTextOriginal.IsSpellCheckRequested = false;
|
||||
this.textBoxListViewTextOriginal.IsWrongWord = false;
|
||||
this.textBoxListViewTextOriginal.LanguageChanged = false;
|
||||
this.textBoxListViewTextOriginal.Location = new System.Drawing.Point(946, 28);
|
||||
this.textBoxListViewTextOriginal.Multiline = true;
|
||||
this.textBoxListViewTextOriginal.Name = "textBoxListViewTextOriginal";
|
||||
this.textBoxListViewTextOriginal.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxListViewTextOriginal.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Both;
|
||||
this.textBoxListViewTextOriginal.SelectedText = "";
|
||||
this.textBoxListViewTextOriginal.SelectionLength = 0;
|
||||
this.textBoxListViewTextOriginal.SelectionStart = 0;
|
||||
this.textBoxListViewTextOriginal.Size = new System.Drawing.Size(16, 84);
|
||||
this.textBoxListViewTextOriginal.TabIndex = 33;
|
||||
this.textBoxListViewTextOriginal.TextBoxFont = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewTextOriginal.Visible = false;
|
||||
this.textBoxListViewTextOriginal.TextChanged += new System.EventHandler(this.textBoxListViewTextOriginal_TextChanged);
|
||||
this.textBoxListViewTextOriginal.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextOriginalKeyDown);
|
||||
this.textBoxListViewTextOriginal.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextOriginalMouseClick);
|
||||
this.textBoxListViewTextOriginal.Enter += new System.EventHandler(this.TextBoxListViewTextOriginalEnter);
|
||||
this.textBoxListViewTextOriginal.KeyUp += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextOriginalKeyUp);
|
||||
this.textBoxListViewTextOriginal.MouseMove += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextOriginalMouseMove);
|
||||
//
|
||||
// timeUpDownStartTime
|
||||
//
|
||||
this.timeUpDownStartTime.AutoSize = true;
|
||||
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownStartTime.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 26);
|
||||
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
|
||||
this.timeUpDownStartTime.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownStartTime.TabIndex = 0;
|
||||
timeCode3.Hours = 0;
|
||||
timeCode3.Milliseconds = 0;
|
||||
timeCode3.Minutes = 0;
|
||||
timeCode3.Seconds = 0;
|
||||
timeCode3.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode3.TotalMilliseconds = 0D;
|
||||
timeCode3.TotalSeconds = 0D;
|
||||
this.timeUpDownStartTime.TimeCode = timeCode3;
|
||||
this.timeUpDownStartTime.UseVideoOffset = false;
|
||||
//
|
||||
// textBoxListViewText
|
||||
//
|
||||
this.textBoxListViewText.AllowDrop = true;
|
||||
this.textBoxListViewText.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.textBoxListViewText.BackColor = System.Drawing.SystemColors.WindowFrame;
|
||||
this.textBoxListViewText.ContextMenuStrip = this.contextMenuStripTextBoxListView;
|
||||
this.textBoxListViewText.CurrentLanguage = "";
|
||||
this.textBoxListViewText.CurrentLineIndex = 0;
|
||||
this.textBoxListViewText.Enabled = false;
|
||||
this.textBoxListViewText.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewText.HideSelection = false;
|
||||
this.textBoxListViewText.IsDictionaryDownloaded = true;
|
||||
this.textBoxListViewText.IsSpellCheckerInitialized = false;
|
||||
this.textBoxListViewText.IsSpellCheckRequested = false;
|
||||
this.textBoxListViewText.IsWrongWord = false;
|
||||
this.textBoxListViewText.LanguageChanged = false;
|
||||
this.textBoxListViewText.Location = new System.Drawing.Point(236, 28);
|
||||
this.textBoxListViewText.Multiline = true;
|
||||
this.textBoxListViewText.Name = "textBoxListViewText";
|
||||
this.textBoxListViewText.Padding = new System.Windows.Forms.Padding(1);
|
||||
this.textBoxListViewText.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Both;
|
||||
this.textBoxListViewText.SelectedText = "";
|
||||
this.textBoxListViewText.SelectionLength = 0;
|
||||
this.textBoxListViewText.SelectionStart = 0;
|
||||
this.textBoxListViewText.Size = new System.Drawing.Size(378, 84);
|
||||
this.textBoxListViewText.TabIndex = 5;
|
||||
this.textBoxListViewText.TextBoxFont = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold);
|
||||
this.textBoxListViewText.TextChanged += new System.EventHandler(this.TextBoxListViewTextTextChanged);
|
||||
this.textBoxListViewText.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextBoxListViewTextKeyDown);
|
||||
this.textBoxListViewText.MouseClick += new System.Windows.Forms.MouseEventHandler(this.TextBoxListViewTextMouseClick);
|
||||
this.textBoxListViewText.Enter += new System.EventHandler(this.TextBoxListViewTextEnter);
|
||||
this.textBoxListViewText.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBoxListViewText_KeyUp);
|
||||
this.textBoxListViewText.Leave += new System.EventHandler(this.textBoxListViewText_Leave);
|
||||
this.textBoxListViewText.MouseMove += new System.Windows.Forms.MouseEventHandler(this.textBoxListViewText_MouseMove);
|
||||
//
|
||||
// mediaPlayer
|
||||
//
|
||||
this.mediaPlayer.AllowDrop = true;
|
||||
this.mediaPlayer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.mediaPlayer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
|
||||
this.mediaPlayer.Chapters = null;
|
||||
this.mediaPlayer.CurrentPosition = 0D;
|
||||
this.mediaPlayer.FontSizeFactor = 1F;
|
||||
this.mediaPlayer.LastParagraph = null;
|
||||
this.mediaPlayer.Location = new System.Drawing.Point(0, 0);
|
||||
this.mediaPlayer.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.mediaPlayer.Name = "mediaPlayer";
|
||||
this.mediaPlayer.ShowFullscreenButton = true;
|
||||
this.mediaPlayer.ShowMuteButton = true;
|
||||
this.mediaPlayer.ShowStopButton = true;
|
||||
this.mediaPlayer.Size = new System.Drawing.Size(219, 246);
|
||||
this.mediaPlayer.SubtitleText = "";
|
||||
this.mediaPlayer.TabIndex = 5;
|
||||
this.mediaPlayer.TextRightToLeft = System.Windows.Forms.RightToLeft.No;
|
||||
this.mediaPlayer.VideoHeight = 0;
|
||||
this.mediaPlayer.VideoPlayer = null;
|
||||
this.mediaPlayer.VideoWidth = 0;
|
||||
this.mediaPlayer.Volume = 0D;
|
||||
this.mediaPlayer.DragDrop += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragDrop);
|
||||
this.mediaPlayer.DragEnter += new System.Windows.Forms.DragEventHandler(this.mediaPlayer_DragEnter);
|
||||
//
|
||||
// audioVisualizer
|
||||
//
|
||||
this.audioVisualizer.AllowDrop = true;
|
||||
this.audioVisualizer.AllowNewSelection = true;
|
||||
this.audioVisualizer.AllowOverlap = false;
|
||||
this.audioVisualizer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.audioVisualizer.BackColor = System.Drawing.Color.Black;
|
||||
this.audioVisualizer.BackgroundColor = System.Drawing.Color.Black;
|
||||
this.audioVisualizer.Chapters = null;
|
||||
this.audioVisualizer.ChaptersColor = System.Drawing.Color.Empty;
|
||||
this.audioVisualizer.ClosenessForBorderSelection = 15;
|
||||
this.audioVisualizer.Color = System.Drawing.Color.GreenYellow;
|
||||
this.audioVisualizer.CursorColor = System.Drawing.Color.Empty;
|
||||
this.audioVisualizer.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.audioVisualizer.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(18)))));
|
||||
this.audioVisualizer.InsertAtVideoPositionShortcut = System.Windows.Forms.Keys.Insert;
|
||||
this.audioVisualizer.Location = new System.Drawing.Point(472, 32);
|
||||
this.audioVisualizer.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.audioVisualizer.MouseWheelScrollUpIsForward = true;
|
||||
this.audioVisualizer.Move100MsLeft = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.Move100MsRight = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.MoveOneSecondLeft = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.MoveOneSecondRight = System.Windows.Forms.Keys.None;
|
||||
this.audioVisualizer.Name = "audioVisualizer";
|
||||
this.audioVisualizer.NewSelectionParagraph = null;
|
||||
this.audioVisualizer.ParagraphColor = System.Drawing.Color.LimeGreen;
|
||||
this.audioVisualizer.ShotChanges = ((System.Collections.Generic.List<double>)(resources.GetObject("audioVisualizer.ShotChanges")));
|
||||
this.audioVisualizer.SelectedColor = System.Drawing.Color.Red;
|
||||
this.audioVisualizer.ShowGridLines = true;
|
||||
this.audioVisualizer.ShowSpectrogram = false;
|
||||
this.audioVisualizer.ShowWaveform = true;
|
||||
this.audioVisualizer.Size = new System.Drawing.Size(499, 229);
|
||||
this.audioVisualizer.StartPositionSeconds = 0D;
|
||||
this.audioVisualizer.TabIndex = 6;
|
||||
this.audioVisualizer.TextBold = true;
|
||||
this.audioVisualizer.TextColor = System.Drawing.Color.Gray;
|
||||
this.audioVisualizer.TextSize = 9F;
|
||||
this.audioVisualizer.VerticalZoomFactor = 1D;
|
||||
this.audioVisualizer.WaveformNotLoadedText = "Click to add waveform";
|
||||
this.audioVisualizer.WavePeaks = null;
|
||||
this.audioVisualizer.ZoomFactor = 1D;
|
||||
this.audioVisualizer.Click += new System.EventHandler(this.AudioWaveform_Click);
|
||||
this.audioVisualizer.DragDrop += new System.Windows.Forms.DragEventHandler(this.AudioWaveformDragDrop);
|
||||
this.audioVisualizer.DragEnter += new System.Windows.Forms.DragEventHandler(this.AudioWaveformDragEnter);
|
||||
this.audioVisualizer.MouseEnter += new System.EventHandler(this.audioVisualizer_MouseEnter);
|
||||
//
|
||||
// timeUpDownVideoPosition
|
||||
//
|
||||
this.timeUpDownVideoPosition.AutoSize = true;
|
||||
this.timeUpDownVideoPosition.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownVideoPosition.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownVideoPosition.Location = new System.Drawing.Point(90, 190);
|
||||
this.timeUpDownVideoPosition.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownVideoPosition.Name = "timeUpDownVideoPosition";
|
||||
this.timeUpDownVideoPosition.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownVideoPosition.TabIndex = 12;
|
||||
timeCode1.Hours = 0;
|
||||
timeCode1.Milliseconds = 0;
|
||||
timeCode1.Minutes = 0;
|
||||
timeCode1.Seconds = 0;
|
||||
timeCode1.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode1.TotalMilliseconds = 0D;
|
||||
timeCode1.TotalSeconds = 0D;
|
||||
this.timeUpDownVideoPosition.TimeCode = timeCode1;
|
||||
this.timeUpDownVideoPosition.UseVideoOffset = false;
|
||||
//
|
||||
// timeUpDownVideoPositionAdjust
|
||||
//
|
||||
this.timeUpDownVideoPositionAdjust.AutoSize = true;
|
||||
this.timeUpDownVideoPositionAdjust.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.timeUpDownVideoPositionAdjust.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F);
|
||||
this.timeUpDownVideoPositionAdjust.Location = new System.Drawing.Point(90, 215);
|
||||
this.timeUpDownVideoPositionAdjust.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.timeUpDownVideoPositionAdjust.Name = "timeUpDownVideoPositionAdjust";
|
||||
this.timeUpDownVideoPositionAdjust.Size = new System.Drawing.Size(113, 27);
|
||||
this.timeUpDownVideoPositionAdjust.TabIndex = 13;
|
||||
timeCode2.Hours = 0;
|
||||
timeCode2.Milliseconds = 0;
|
||||
timeCode2.Minutes = 0;
|
||||
timeCode2.Seconds = 0;
|
||||
timeCode2.TimeSpan = System.TimeSpan.Parse("00:00:00");
|
||||
timeCode2.TotalMilliseconds = 0D;
|
||||
timeCode2.TotalSeconds = 0D;
|
||||
this.timeUpDownVideoPositionAdjust.TimeCode = timeCode2;
|
||||
this.timeUpDownVideoPositionAdjust.UseVideoOffset = false;
|
||||
this.exporImportTofromWordToolStripMenuItem.Name = "exporImportTofromWordToolStripMenuItem";
|
||||
this.exporImportTofromWordToolStripMenuItem.Size = new System.Drawing.Size(238, 22);
|
||||
this.exporImportTofromWordToolStripMenuItem.Text = "Export to / import from Word docx...";
|
||||
this.exporImportTofromWordToolStripMenuItem.Click += new System.EventHandler(this.exporImportTofromWordToolStripMenuItem_Click);
|
||||
//
|
||||
// Main
|
||||
//
|
||||
@ -6097,5 +6106,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private System.Windows.Forms.ToolStripMenuItem sortByGapToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButtonBurnIn;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButtonSpellCheck;
|
||||
private System.Windows.Forms.ToolStripMenuItem exporImportTofromWordToolStripMenuItem;
|
||||
}
|
||||
}
|
@ -33926,7 +33926,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
using (var form = new AudioToText(_videoFileName))
|
||||
using (var form = new AudioToText(_videoFileName, this))
|
||||
{
|
||||
var result = form.ShowDialog(this);
|
||||
if (result != DialogResult.OK)
|
||||
@ -33967,13 +33967,27 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void Main_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.X > 72 && e.X <= (122 + textBoxListViewText.Height))
|
||||
if (e.X > 72 && e.X <= (122 + textBoxListViewText.Height) && !textBoxListViewText.Enabled)
|
||||
{
|
||||
if (!textBoxListViewText.Enabled)
|
||||
InsertLineToolStripMenuItemClick(null, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void exporImportTofromWordToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var form = new TranslateExportImport(_subtitle))
|
||||
{
|
||||
if (form.ShowDialog(this) != DialogResult.OK)
|
||||
{
|
||||
InsertLineToolStripMenuItemClick(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
SaveSubtitleListviewIndices();
|
||||
_subtitle = form.Subtitle;
|
||||
SubtitleListview1.Fill(_subtitle, _subtitleOriginal);
|
||||
RestoreSubtitleListviewIndices();
|
||||
RefreshSelectedParagraph();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -500,37 +500,37 @@
|
||||
<data name="toolStripButtonIttProperties.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButtonAssStyleManager.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@ -863,7 +863,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAXQBLQF0AS0BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAXwBLQF8AS0BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
64
src/ui/Forms/Translate/SplitHelper.cs
Normal file
64
src/ui/Forms/Translate/SplitHelper.cs
Normal file
@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
{
|
||||
internal static class SplitHelper
|
||||
{
|
||||
internal class SplitListItem
|
||||
{
|
||||
internal List<string> Lines { get; set; }
|
||||
|
||||
internal double DiffFromAverage(double avg)
|
||||
{
|
||||
return Lines.Sum(line => Math.Abs(avg - line.Length));
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> SplitToXLines(int lineCount, string input, int singleLineMaxLength)
|
||||
{
|
||||
var text = input.Trim();
|
||||
var results = new List<SplitListItem>();
|
||||
for (var maxLength = singleLineMaxLength; maxLength > 5; maxLength--)
|
||||
{
|
||||
var list = new List<string>();
|
||||
var lastIndexOfSpace = -1;
|
||||
var start = 0;
|
||||
for (var i = 0; i < text.Length; i++)
|
||||
{
|
||||
var ch = text[i];
|
||||
if (ch == ' ')
|
||||
{
|
||||
if (i - start > maxLength && lastIndexOfSpace > start)
|
||||
{
|
||||
var line = text.Substring(start, lastIndexOfSpace - start);
|
||||
list.Add(line.Trim());
|
||||
start = lastIndexOfSpace + 1;
|
||||
}
|
||||
lastIndexOfSpace = i;
|
||||
}
|
||||
}
|
||||
|
||||
var lastLine = text.Substring(start);
|
||||
list.Add(lastLine.Trim());
|
||||
if (list.Count > lineCount)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
results.Add(new SplitListItem { Lines = list });
|
||||
}
|
||||
|
||||
var avg = text.Length / (double)lineCount;
|
||||
var best = results
|
||||
.Where(p => p.Lines.Count == lineCount)
|
||||
.OrderBy(p => p.DiffFromAverage(avg))
|
||||
.FirstOrDefault() ?? results.Where(p => p.Lines.Count == lineCount)
|
||||
.OrderBy(p => p.DiffFromAverage(avg))
|
||||
.FirstOrDefault();
|
||||
|
||||
return best == null ? new List<string> { text } : best.Lines;
|
||||
}
|
||||
}
|
||||
}
|
171
src/ui/Forms/Translate/TranslateExportImport.Designer.cs
generated
Normal file
171
src/ui/Forms/Translate/TranslateExportImport.Designer.cs
generated
Normal file
@ -0,0 +1,171 @@
|
||||
namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
{
|
||||
partial class TranslateExportImport
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.buttonOk = new System.Windows.Forms.Button();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBoxAutoMerge = new System.Windows.Forms.CheckBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.checkBox2 = new System.Windows.Forms.CheckBox();
|
||||
this.buttonImport = new System.Windows.Forms.Button();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(376, 247);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCancel.TabIndex = 11;
|
||||
this.buttonCancel.Text = "Cancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonOk
|
||||
//
|
||||
this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonOk.Location = new System.Drawing.Point(295, 247);
|
||||
this.buttonOk.Name = "buttonOk";
|
||||
this.buttonOk.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonOk.TabIndex = 10;
|
||||
this.buttonOk.Text = "OK";
|
||||
this.buttonOk.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.checkBoxAutoMerge);
|
||||
this.groupBox1.Controls.Add(this.button1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(439, 100);
|
||||
this.groupBox1.TabIndex = 12;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Step 1 - Export";
|
||||
//
|
||||
// checkBoxAutoMerge
|
||||
//
|
||||
this.checkBoxAutoMerge.AutoSize = true;
|
||||
this.checkBoxAutoMerge.Checked = true;
|
||||
this.checkBoxAutoMerge.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.checkBoxAutoMerge.Location = new System.Drawing.Point(7, 30);
|
||||
this.checkBoxAutoMerge.Name = "checkBoxAutoMerge";
|
||||
this.checkBoxAutoMerge.Size = new System.Drawing.Size(129, 17);
|
||||
this.checkBoxAutoMerge.TabIndex = 12;
|
||||
this.checkBoxAutoMerge.Text = "Merge continues lines";
|
||||
this.checkBoxAutoMerge.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button1.Location = new System.Drawing.Point(283, 60);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(144, 23);
|
||||
this.button1.TabIndex = 11;
|
||||
this.button1.Text = "Export...";
|
||||
this.button1.UseVisualStyleBackColor = true;
|
||||
this.button1.Click += new System.EventHandler(this.ButtonExportClick);
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox2.Controls.Add(this.checkBox2);
|
||||
this.groupBox2.Controls.Add(this.buttonImport);
|
||||
this.groupBox2.Location = new System.Drawing.Point(12, 130);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(439, 100);
|
||||
this.groupBox2.TabIndex = 13;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Step 2 - Import";
|
||||
//
|
||||
// checkBox2
|
||||
//
|
||||
this.checkBox2.AutoSize = true;
|
||||
this.checkBox2.Location = new System.Drawing.Point(7, 61);
|
||||
this.checkBox2.Name = "checkBox2";
|
||||
this.checkBox2.Size = new System.Drawing.Size(198, 17);
|
||||
this.checkBox2.TabIndex = 14;
|
||||
this.checkBox2.Text = "Import as translation (translate mode)";
|
||||
this.checkBox2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonImport
|
||||
//
|
||||
this.buttonImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonImport.Location = new System.Drawing.Point(283, 61);
|
||||
this.buttonImport.Name = "buttonImport";
|
||||
this.buttonImport.Size = new System.Drawing.Size(144, 23);
|
||||
this.buttonImport.TabIndex = 11;
|
||||
this.buttonImport.Text = "Import...";
|
||||
this.buttonImport.UseVisualStyleBackColor = true;
|
||||
this.buttonImport.Click += new System.EventHandler(this.ButtonImportClick);
|
||||
//
|
||||
// TranslateExportImport
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(463, 282);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.buttonOk);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "TranslateExportImport";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Export to / import from Word (.docx)";
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.groupBox2.ResumeLayout(false);
|
||||
this.groupBox2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Button buttonOk;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
private System.Windows.Forms.Button button1;
|
||||
private System.Windows.Forms.GroupBox groupBox2;
|
||||
private System.Windows.Forms.Button buttonImport;
|
||||
private System.Windows.Forms.CheckBox checkBoxAutoMerge;
|
||||
private System.Windows.Forms.CheckBox checkBox2;
|
||||
}
|
||||
}
|
364
src/ui/Forms/Translate/TranslateExportImport.cs
Normal file
364
src/ui/Forms/Translate/TranslateExportImport.cs
Normal file
@ -0,0 +1,364 @@
|
||||
using Nikse.SubtitleEdit.Core.Common;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Xceed.Document.NET;
|
||||
using Xceed.Words.NET;
|
||||
|
||||
//TODO: formatting extract / merge
|
||||
//TODO: fix italic for split
|
||||
//TODO: remember check boxes settings
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
{
|
||||
public partial class TranslateExportImport : Form
|
||||
{
|
||||
public Subtitle Subtitle { get; private set; }
|
||||
public Subtitle SubtitleOriginal { get; private set; }
|
||||
private Dictionary<int, int> _skipIndices;
|
||||
|
||||
public TranslateExportImport(Subtitle subtitle)
|
||||
{
|
||||
InitializeComponent();
|
||||
SubtitleOriginal = subtitle;
|
||||
_skipIndices = new Dictionary<int, int>();
|
||||
}
|
||||
|
||||
private void ButtonExportClick(object sender, EventArgs e)
|
||||
{
|
||||
using (var saveFileDialog = new SaveFileDialog
|
||||
{
|
||||
Title = LanguageSettings.Current.General.OpenSubtitle,
|
||||
FileName = "translate.docx",
|
||||
Filter = "Word docx files|*.docx",
|
||||
})
|
||||
{
|
||||
if (saveFileDialog.ShowDialog() != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Subtitle = new Subtitle(SubtitleOriginal, false);
|
||||
_skipIndices = new Dictionary<int, int>();
|
||||
var texts = new List<string>();
|
||||
var mergeCount = 0;
|
||||
var autoMerge = checkBoxAutoMerge.Checked;
|
||||
var language = LanguageAutoDetect.AutoDetectGoogleLanguage(Subtitle);
|
||||
using (var document = DocX.Create(saveFileDialog.FileName))
|
||||
{
|
||||
for (var index = 0; index < Subtitle.Paragraphs.Count; index++)
|
||||
{
|
||||
if (mergeCount > 0)
|
||||
{
|
||||
mergeCount--;
|
||||
continue;
|
||||
}
|
||||
|
||||
var subtitleParagraph = Subtitle.Paragraphs[index];
|
||||
var text = subtitleParagraph.Text;
|
||||
if (autoMerge)
|
||||
{
|
||||
if (MergeWithThreeNext(Subtitle, index, language))
|
||||
{
|
||||
mergeCount = 3;
|
||||
_skipIndices.Add(index, mergeCount);
|
||||
text = Utilities.RemoveLineBreaks(text + Environment.NewLine +
|
||||
Subtitle.Paragraphs[index + 1].Text + Environment.NewLine +
|
||||
Subtitle.Paragraphs[index + 2].Text);
|
||||
}
|
||||
else if (MergeWithTwoNext(Subtitle, index, language))
|
||||
{
|
||||
mergeCount = 2;
|
||||
_skipIndices.Add(index, mergeCount);
|
||||
text = Utilities.RemoveLineBreaks(text + Environment.NewLine +
|
||||
Subtitle.Paragraphs[index + 1].Text + Environment.NewLine +
|
||||
Subtitle.Paragraphs[index + 2].Text);
|
||||
}
|
||||
else if (MergeWithNext(Subtitle, index, language))
|
||||
{
|
||||
mergeCount = 1;
|
||||
_skipIndices.Add(index, mergeCount);
|
||||
text = Utilities.RemoveLineBreaks(text + Environment.NewLine + Subtitle.Paragraphs[index + 1].Text);
|
||||
}
|
||||
}
|
||||
|
||||
texts.Add(text);
|
||||
}
|
||||
|
||||
var table = document.AddTable(texts.Count, 1);
|
||||
table.AutoFit = AutoFit.Window;
|
||||
for (var index = 0; index < texts.Count; index++)
|
||||
{
|
||||
var text = texts[index];
|
||||
table.Rows[index].Cells[0].InsertParagraph(text);
|
||||
}
|
||||
|
||||
var p = document.InsertParagraph(string.Empty);
|
||||
p.Alignment = Alignment.both;
|
||||
p.InsertTableAfterSelf(table);
|
||||
document.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonImportClick(object sender, EventArgs e)
|
||||
{
|
||||
using (var openFileDialog1 = new OpenFileDialog())
|
||||
{
|
||||
openFileDialog1.Title = LanguageSettings.Current.General.OpenSubtitle;
|
||||
openFileDialog1.FileName = string.Empty;
|
||||
openFileDialog1.Filter = "Word docx files|*.docx";
|
||||
openFileDialog1.FileName = string.Empty;
|
||||
var result = openFileDialog1.ShowDialog(this);
|
||||
if (result != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (var document = DocX.Load(openFileDialog1.FileName))
|
||||
{
|
||||
var table = document.Tables.FirstOrDefault();
|
||||
if (table == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var splitLines = table.Rows.Count + _skipIndices.Count == Subtitle.Paragraphs.Count;
|
||||
|
||||
if (!splitLines && table.Rows.Count != Subtitle.Paragraphs.Count)
|
||||
{
|
||||
var res = MessageBox.Show($"Table rows ({table.Rows.Count} + {_skipIndices.Count}) does not match subtitle count ({Subtitle.Paragraphs.Count})" + Environment.NewLine +
|
||||
"Continue?",
|
||||
"Subtitel Edit", MessageBoxButtons.YesNoCancel);
|
||||
if (res != DialogResult.Yes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var language = LanguageAutoDetect.AutoDetectGoogleLanguage(Subtitle);
|
||||
var count = 0;
|
||||
foreach (var tableRow in table.Rows)
|
||||
{
|
||||
var p = Subtitle.GetParagraphOrDefault(count);
|
||||
if (p != null)
|
||||
{
|
||||
p.Text = string.Empty;
|
||||
foreach (var paragraph in tableRow.Cells[0].Paragraphs)
|
||||
{
|
||||
p.Text = (p.Text + Environment.NewLine + paragraph.Text).Trim();
|
||||
}
|
||||
|
||||
var text = string.Join(Environment.NewLine, p.Text.SplitToLines());
|
||||
if (_skipIndices.TryGetValue(count, out var splitCount))
|
||||
{
|
||||
var lines = SplitResult(text, splitCount, language);
|
||||
while (lines.Count < splitCount)
|
||||
{
|
||||
lines.Add(string.Empty);
|
||||
}
|
||||
|
||||
foreach (var line in lines)
|
||||
{
|
||||
p = Subtitle.GetParagraphOrDefault(count);
|
||||
p.Text = line;
|
||||
count++;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
p.Text = text;
|
||||
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool MergeWithNext(Subtitle subtitle, int i, string source)
|
||||
{
|
||||
if (i + 1 >= subtitle.Paragraphs.Count || source.ToLowerInvariant() == "zh" || source.ToLowerInvariant() == "ja")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var p = subtitle.Paragraphs[i];
|
||||
var text = HtmlUtil.RemoveHtmlTags(p.Text, true).TrimEnd('"');
|
||||
if (text.EndsWith(".", StringComparison.Ordinal) ||
|
||||
text.EndsWith("!", StringComparison.Ordinal) ||
|
||||
text.EndsWith("?", StringComparison.Ordinal) ||
|
||||
text.EndsWith(")", StringComparison.Ordinal) ||
|
||||
text.EndsWith("]", StringComparison.Ordinal) ||
|
||||
text.EndsWith(":", StringComparison.Ordinal) ||
|
||||
text.EndsWith("♪", StringComparison.Ordinal) ||
|
||||
text.EndsWith("♫", StringComparison.Ordinal))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var next = subtitle.Paragraphs[i + 1];
|
||||
return next.StartTime.TotalMilliseconds - p.EndTime.TotalMilliseconds < 500;
|
||||
}
|
||||
|
||||
private static bool MergeWithTwoNext(Subtitle subtitle, int i, string source)
|
||||
{
|
||||
if (i + 2 >= subtitle.Paragraphs.Count || source.ToLowerInvariant() == "zh" || source.ToLowerInvariant() == "ja")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return MergeWithNext(subtitle, i, source) && MergeWithNext(subtitle, i + 1, source);
|
||||
}
|
||||
|
||||
private static bool MergeWithThreeNext(Subtitle subtitle, int i, string source)
|
||||
{
|
||||
if (i + 3 >= subtitle.Paragraphs.Count || source.ToLowerInvariant() == "zh" || source.ToLowerInvariant() == "ja")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return MergeWithNext(subtitle, i, source) && MergeWithNext(subtitle, i + 1, source) && MergeWithNext(subtitle, i + 2, source);
|
||||
}
|
||||
|
||||
private static List<string> SplitResult(string result, int mergeCount, string language)
|
||||
{
|
||||
if (mergeCount == 1)
|
||||
{
|
||||
var arr = Utilities.AutoBreakLine(result, 84, 1, language).SplitToLines();
|
||||
if (arr.Count == 1)
|
||||
{
|
||||
arr = Utilities.AutoBreakLine(result, 42, 1, language).SplitToLines();
|
||||
}
|
||||
|
||||
if (arr.Count == 1)
|
||||
{
|
||||
arr = Utilities.AutoBreakLine(result, 22, 1, language).SplitToLines();
|
||||
}
|
||||
|
||||
if (arr.Count == 2)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Count == 1)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
return new List<string> { result };
|
||||
}
|
||||
|
||||
if (mergeCount == 2)
|
||||
{
|
||||
var arr = SplitHelper.SplitToXLines(3, result, 84).ToArray();
|
||||
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[2], 42, language == "zh" ? 0 : 25, language),
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Length == 2)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Length == 1)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
return new List<string> { result };
|
||||
}
|
||||
|
||||
if (mergeCount == 3)
|
||||
{
|
||||
var arr = SplitHelper.SplitToXLines(4, result, 84).ToArray();
|
||||
|
||||
if (arr.Length == 4)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[2], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[3], 42, language == "zh" ? 0 : 25, language),
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Length == 3)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[2], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Length == 2)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
Utilities.AutoBreakLine(arr[1], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
if (arr.Length == 1)
|
||||
{
|
||||
return new List<string>
|
||||
{
|
||||
Utilities.AutoBreakLine(arr[0], 42, language == "zh" ? 0 : 25, language),
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
return new List<string> { result };
|
||||
}
|
||||
|
||||
return new List<string> { result };
|
||||
}
|
||||
}
|
||||
}
|
120
src/ui/Forms/Translate/TranslateExportImport.resx
Normal file
120
src/ui/Forms/Translate/TranslateExportImport.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -193,7 +193,7 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
this.listViewTranslate.FullRowSelect = true;
|
||||
this.listViewTranslate.GridLines = true;
|
||||
this.listViewTranslate.HideSelection = false;
|
||||
this.listViewTranslate.Location = new System.Drawing.Point(26, 43);
|
||||
this.listViewTranslate.Location = new System.Drawing.Point(12, -6);
|
||||
this.listViewTranslate.Name = "listViewTranslate";
|
||||
this.listViewTranslate.Size = new System.Drawing.Size(886, 441);
|
||||
this.listViewTranslate.TabIndex = 7;
|
||||
@ -223,10 +223,10 @@ namespace Nikse.SubtitleEdit.Forms.Translate
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "TranslateViaCopyPaste";
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(MainForm_KeyDown);
|
||||
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||
this.ResizeEnd += new System.EventHandler(this.MainForm_ResizeEnd);
|
||||
this.Shown += new System.EventHandler(this.MainForm_Shown);
|
||||
this.ResizeEnd += new System.EventHandler(this.MainForm_ResizeEnd);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MainForm_KeyDown);
|
||||
this.Resize += new System.EventHandler(this.MainForm_Resize);
|
||||
((System.ComponentModel.ISupportInitialize)(this.numericUpDownMaxBytes)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
@ -88,6 +88,12 @@
|
||||
<Reference Include="Vosk, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\Vosk.0.3.38\lib\netstandard2.0\Vosk.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Document.NET, Version=2.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\DocX.2.2.0\lib\net40\Xceed.Document.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Words.NET, Version=2.2.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\packages\DocX.2.2.0\lib\net40\Xceed.Words.NET.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Controls\SETextBox.cs">
|
||||
@ -1122,12 +1128,19 @@
|
||||
<Compile Include="Forms\Styles\TimedTextStyles.Designer.cs">
|
||||
<DependentUpon>TimedTextStyles.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Translate\SplitHelper.cs" />
|
||||
<Compile Include="Forms\Translate\TranslateBlock.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Translate\TranslateBlock.Designer.cs">
|
||||
<DependentUpon>TranslateBlock.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Translate\TranslateExportImport.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Translate\TranslateExportImport.Designer.cs">
|
||||
<DependentUpon>TranslateExportImport.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Translate\TranslateViaCopyPaste.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -1880,6 +1893,9 @@
|
||||
<EmbeddedResource Include="Forms\Translate\TranslateBlock.resx">
|
||||
<DependentUpon>TranslateBlock.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Translate\TranslateExportImport.resx">
|
||||
<DependentUpon>TranslateExportImport.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Translate\TranslateViaCopyPaste.resx">
|
||||
<DependentUpon>TranslateViaCopyPaste.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="DocX" version="2.2.0" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net462" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net462" />
|
||||
<package id="Microsoft.Net.Http" version="2.2.29" targetFramework="net462" />
|
||||
|
Loading…
Reference in New Issue
Block a user