mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Included loader (+auto-gen) of language de-serializer
This commit is contained in:
parent
00b63d8f20
commit
f75ab4700a
3
.gitignore
vendored
3
.gitignore
vendored
@ -18,3 +18,6 @@
|
||||
/src/SubtitleEdit.csproj.DotSettings
|
||||
/src/Test/Test.csproj.user
|
||||
/tabspace.exe
|
||||
/src/Performance1.psess
|
||||
/src/SubtitleEdit.psess
|
||||
/src/SubtitleEdit140625.vsp
|
||||
|
@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Previous text takes all gap time</ProlongEndTime>
|
||||
<DivideEven>Texts divides gap time</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Rip subtitles from ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>DVD files/info</DvdGroupTitle>
|
||||
<IfoFile>IFO file</IfoFile>
|
||||
@ -303,7 +303,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Reading subtitle data...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripping vob file {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO type is '{0}' and not 'DVDVIDEO-VTS'.{1}Try another file than {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Choose language</Title>
|
||||
<ChooseLanguageStreamId>Choose language (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -1,160 +1,160 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
partial class AddWareForm
|
||||
{
|
||||
/// <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.labelPleaseWait = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.buttonRipWave = new System.Windows.Forms.Button();
|
||||
this.labelProgress = new System.Windows.Forms.Label();
|
||||
this.labelSourcevideoFile = new System.Windows.Forms.Label();
|
||||
this.labelVideoFileName = new System.Windows.Forms.Label();
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.labelInfo = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// labelPleaseWait
|
||||
//
|
||||
this.labelPleaseWait.AutoSize = true;
|
||||
this.labelPleaseWait.Location = new System.Drawing.Point(176, 59);
|
||||
this.labelPleaseWait.Name = "labelPleaseWait";
|
||||
this.labelPleaseWait.Size = new System.Drawing.Size(203, 13);
|
||||
this.labelPleaseWait.TabIndex = 14;
|
||||
this.labelPleaseWait.Text = "This may take a few minutes - please wait";
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(12, 80);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(522, 23);
|
||||
this.progressBar1.TabIndex = 12;
|
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
this.openFileDialog1.FileName = "openFileDialog1";
|
||||
//
|
||||
// buttonRipWave
|
||||
//
|
||||
this.buttonRipWave.Location = new System.Drawing.Point(12, 54);
|
||||
this.buttonRipWave.Name = "buttonRipWave";
|
||||
this.buttonRipWave.Size = new System.Drawing.Size(158, 23);
|
||||
this.buttonRipWave.TabIndex = 13;
|
||||
this.buttonRipWave.Text = "Generate wave form data";
|
||||
this.buttonRipWave.UseVisualStyleBackColor = true;
|
||||
this.buttonRipWave.Click += new System.EventHandler(this.buttonRipWave_Click);
|
||||
//
|
||||
// labelProgress
|
||||
//
|
||||
this.labelProgress.AutoSize = true;
|
||||
this.labelProgress.Location = new System.Drawing.Point(12, 106);
|
||||
this.labelProgress.Name = "labelProgress";
|
||||
this.labelProgress.Size = new System.Drawing.Size(70, 13);
|
||||
this.labelProgress.TabIndex = 9;
|
||||
this.labelProgress.Text = "labelProgress";
|
||||
//
|
||||
// labelSourcevideoFile
|
||||
//
|
||||
this.labelSourcevideoFile.AutoSize = true;
|
||||
this.labelSourcevideoFile.Location = new System.Drawing.Point(14, 9);
|
||||
this.labelSourcevideoFile.Name = "labelSourcevideoFile";
|
||||
this.labelSourcevideoFile.Size = new System.Drawing.Size(89, 13);
|
||||
this.labelSourcevideoFile.TabIndex = 15;
|
||||
this.labelSourcevideoFile.Text = "Source video file:";
|
||||
//
|
||||
// labelVideoFileName
|
||||
//
|
||||
this.labelVideoFileName.AutoSize = true;
|
||||
this.labelVideoFileName.Location = new System.Drawing.Point(12, 26);
|
||||
this.labelVideoFileName.Name = "labelVideoFileName";
|
||||
this.labelVideoFileName.Size = new System.Drawing.Size(100, 13);
|
||||
this.labelVideoFileName.TabIndex = 16;
|
||||
this.labelVideoFileName.Text = "labelVideoFileName";
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Location = new System.Drawing.Point(442, 109);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(92, 23);
|
||||
this.buttonCancel.TabIndex = 17;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||
//
|
||||
// labelInfo
|
||||
//
|
||||
this.labelInfo.ForeColor = System.Drawing.Color.Gray;
|
||||
this.labelInfo.Location = new System.Drawing.Point(427, 6);
|
||||
this.labelInfo.Name = "labelInfo";
|
||||
this.labelInfo.Size = new System.Drawing.Size(120, 13);
|
||||
this.labelInfo.TabIndex = 18;
|
||||
this.labelInfo.Text = "label1";
|
||||
this.labelInfo.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// AddWareForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(550, 138);
|
||||
this.Controls.Add(this.labelInfo);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.labelVideoFileName);
|
||||
this.Controls.Add(this.labelSourcevideoFile);
|
||||
this.Controls.Add(this.labelPleaseWait);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.buttonRipWave);
|
||||
this.Controls.Add(this.labelProgress);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AddWareForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Generate wave form data";
|
||||
this.Shown += new System.EventHandler(this.AddWareForm_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AddWareForm_KeyDown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label labelPleaseWait;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||
private System.Windows.Forms.Button buttonRipWave;
|
||||
private System.Windows.Forms.Label labelProgress;
|
||||
private System.Windows.Forms.Label labelSourcevideoFile;
|
||||
private System.Windows.Forms.Label labelVideoFileName;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Label labelInfo;
|
||||
}
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
partial class AddWaveForm
|
||||
{
|
||||
/// <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.labelPleaseWait = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
|
||||
this.buttonRipWave = new System.Windows.Forms.Button();
|
||||
this.labelProgress = new System.Windows.Forms.Label();
|
||||
this.labelSourcevideoFile = new System.Windows.Forms.Label();
|
||||
this.labelVideoFileName = new System.Windows.Forms.Label();
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.labelInfo = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// labelPleaseWait
|
||||
//
|
||||
this.labelPleaseWait.AutoSize = true;
|
||||
this.labelPleaseWait.Location = new System.Drawing.Point(176, 59);
|
||||
this.labelPleaseWait.Name = "labelPleaseWait";
|
||||
this.labelPleaseWait.Size = new System.Drawing.Size(203, 13);
|
||||
this.labelPleaseWait.TabIndex = 14;
|
||||
this.labelPleaseWait.Text = "This may take a few minutes - please wait";
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(12, 80);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(522, 23);
|
||||
this.progressBar1.TabIndex = 12;
|
||||
//
|
||||
// openFileDialog1
|
||||
//
|
||||
this.openFileDialog1.FileName = "openFileDialog1";
|
||||
//
|
||||
// buttonRipWave
|
||||
//
|
||||
this.buttonRipWave.Location = new System.Drawing.Point(12, 54);
|
||||
this.buttonRipWave.Name = "buttonRipWave";
|
||||
this.buttonRipWave.Size = new System.Drawing.Size(158, 23);
|
||||
this.buttonRipWave.TabIndex = 13;
|
||||
this.buttonRipWave.Text = "Generate wave form data";
|
||||
this.buttonRipWave.UseVisualStyleBackColor = true;
|
||||
this.buttonRipWave.Click += new System.EventHandler(this.buttonRipWave_Click);
|
||||
//
|
||||
// labelProgress
|
||||
//
|
||||
this.labelProgress.AutoSize = true;
|
||||
this.labelProgress.Location = new System.Drawing.Point(12, 106);
|
||||
this.labelProgress.Name = "labelProgress";
|
||||
this.labelProgress.Size = new System.Drawing.Size(70, 13);
|
||||
this.labelProgress.TabIndex = 9;
|
||||
this.labelProgress.Text = "labelProgress";
|
||||
//
|
||||
// labelSourcevideoFile
|
||||
//
|
||||
this.labelSourcevideoFile.AutoSize = true;
|
||||
this.labelSourcevideoFile.Location = new System.Drawing.Point(14, 9);
|
||||
this.labelSourcevideoFile.Name = "labelSourcevideoFile";
|
||||
this.labelSourcevideoFile.Size = new System.Drawing.Size(89, 13);
|
||||
this.labelSourcevideoFile.TabIndex = 15;
|
||||
this.labelSourcevideoFile.Text = "Source video file:";
|
||||
//
|
||||
// labelVideoFileName
|
||||
//
|
||||
this.labelVideoFileName.AutoSize = true;
|
||||
this.labelVideoFileName.Location = new System.Drawing.Point(12, 26);
|
||||
this.labelVideoFileName.Name = "labelVideoFileName";
|
||||
this.labelVideoFileName.Size = new System.Drawing.Size(100, 13);
|
||||
this.labelVideoFileName.TabIndex = 16;
|
||||
this.labelVideoFileName.Text = "labelVideoFileName";
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Location = new System.Drawing.Point(442, 109);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(92, 23);
|
||||
this.buttonCancel.TabIndex = 17;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||
//
|
||||
// labelInfo
|
||||
//
|
||||
this.labelInfo.ForeColor = System.Drawing.Color.Gray;
|
||||
this.labelInfo.Location = new System.Drawing.Point(427, 6);
|
||||
this.labelInfo.Name = "labelInfo";
|
||||
this.labelInfo.Size = new System.Drawing.Size(120, 13);
|
||||
this.labelInfo.TabIndex = 18;
|
||||
this.labelInfo.Text = "label1";
|
||||
this.labelInfo.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
||||
//
|
||||
// AddWareForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(550, 138);
|
||||
this.Controls.Add(this.labelInfo);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.Controls.Add(this.labelVideoFileName);
|
||||
this.Controls.Add(this.labelSourcevideoFile);
|
||||
this.Controls.Add(this.labelPleaseWait);
|
||||
this.Controls.Add(this.progressBar1);
|
||||
this.Controls.Add(this.buttonRipWave);
|
||||
this.Controls.Add(this.labelProgress);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "AddWareForm";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "Generate wave form data";
|
||||
this.Shown += new System.EventHandler(this.AddWareForm_Shown);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.AddWareForm_KeyDown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label labelPleaseWait;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||
private System.Windows.Forms.Button buttonRipWave;
|
||||
private System.Windows.Forms.Label labelProgress;
|
||||
private System.Windows.Forms.Label labelSourcevideoFile;
|
||||
private System.Windows.Forms.Label labelVideoFileName;
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Label labelInfo;
|
||||
}
|
||||
}
|
@ -1,391 +1,391 @@
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.VideoFormats;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public sealed partial class AddWareForm : Form
|
||||
{
|
||||
public string SourceVideoFileName { get; private set; }
|
||||
private bool _cancel = false;
|
||||
private string _wavFileName = null;
|
||||
private string _spectrogramDirectory;
|
||||
public List<Bitmap> SpectrogramBitmaps { get; private set; }
|
||||
private string _encodeParamters;
|
||||
private const string RetryEncodeParameters = "acodec=s16l";
|
||||
private int _audioTrackNumber = -1;
|
||||
private int _delayInMilliseconds = 0;
|
||||
|
||||
public AddWareForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonCancel.Visible = false;
|
||||
labelInfo.Text = string.Empty;
|
||||
}
|
||||
|
||||
public WavePeakGenerator WavePeak { get; private set; }
|
||||
|
||||
public void Initialize(string videoFile, string spectrogramDirectory, int audioTrackNumber)
|
||||
{
|
||||
_audioTrackNumber = audioTrackNumber;
|
||||
if (_audioTrackNumber < 0)
|
||||
_audioTrackNumber = 0;
|
||||
Text = Configuration.Settings.Language.AddWaveForm.Title;
|
||||
buttonRipWave.Text = Configuration.Settings.Language.AddWaveForm.GenerateWaveFormData;
|
||||
labelPleaseWait.Text = Configuration.Settings.Language.AddWaveForm.PleaseWait;
|
||||
labelVideoFileName.Text = videoFile;
|
||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||
labelSourcevideoFile.Text = Configuration.Settings.Language.AddWaveForm.SourceVideoFile;
|
||||
_spectrogramDirectory = spectrogramDirectory;
|
||||
_encodeParamters = Configuration.Settings.General.VlcWaveTranscodeSettings;
|
||||
}
|
||||
|
||||
private void buttonRipWave_Click(object sender, EventArgs e)
|
||||
{
|
||||
buttonRipWave.Enabled = false;
|
||||
_cancel = false;
|
||||
bool runningOnWindows = false;
|
||||
SourceVideoFileName = labelVideoFileName.Text;
|
||||
string targetFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".wav");
|
||||
string parameters = "\"" + SourceVideoFileName + "\" -I dummy -vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout=\"#transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=" + targetFile + "}\" vlc://quit";
|
||||
// string parameters = "\"" + SourceVideoFileName + "\" -I dummy -vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout=\"#transcode{acodec=s16l,channels=2,ab=128,samplerate=24000}:std{access=file,mux=wav,dst=" + targetFile + "}\" vlc://quit";
|
||||
string exeFilePath;
|
||||
if (Utilities.IsRunningOnLinux() || Utilities.IsRunningOnMac())
|
||||
{
|
||||
exeFilePath = "cvlc";
|
||||
parameters = "-vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout '#transcode{" + _encodeParamters + "}:std{mux=wav,access=file,dst=" + targetFile + "}' \"" + SourceVideoFileName + "\" vlc://quit";
|
||||
}
|
||||
else // windows
|
||||
{
|
||||
runningOnWindows = true;
|
||||
exeFilePath = Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic.GetVlcPath("vlc.exe");
|
||||
if (!System.IO.File.Exists(exeFilePath))
|
||||
{
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction && File.Exists(Configuration.Settings.General.FFMPEGLocation))
|
||||
{
|
||||
// We will run FFMPEG
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (MessageBox.Show(Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFound + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
Configuration.Settings.Language.AddWaveForm.GoToVlcMediaPlayerHomePage,
|
||||
Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFoundTitle, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.videolan.org/");
|
||||
}
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
labelInfo.Text = "VLC";
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction && File.Exists(Configuration.Settings.General.FFMPEGLocation))
|
||||
{
|
||||
string FFMPEGWaveTranscodeSettings = "-i \"{0}\" -vn -ar 24000 -ac 2 -ab 128 -vol 448 -f wav \"{1}\"";
|
||||
//-i indicates the input
|
||||
//-vn means no video ouput
|
||||
//-ar 44100 indicates the sampling frequency.
|
||||
//-ab indicates the bit rate (in this example 160kb/sec)
|
||||
//-vol 448 will boot volume... 256 is normal
|
||||
//-ac 2 means 2 channels
|
||||
|
||||
exeFilePath = Configuration.Settings.General.FFMPEGLocation;
|
||||
parameters = string.Format(FFMPEGWaveTranscodeSettings, SourceVideoFileName, targetFile);
|
||||
labelInfo.Text = "FFMPEG";
|
||||
}
|
||||
|
||||
labelPleaseWait.Visible = true;
|
||||
Process process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo(exeFilePath, parameters);
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.Start();
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
progressBar1.Visible = true;
|
||||
double seconds = 0;
|
||||
buttonCancel.Visible = true;
|
||||
try
|
||||
{
|
||||
process.PriorityClass = ProcessPriorityClass.Normal;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
while (!process.HasExited)
|
||||
{
|
||||
Application.DoEvents();
|
||||
System.Threading.Thread.Sleep(100);
|
||||
seconds += 0.1;
|
||||
if (seconds < 60)
|
||||
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingSeconds, seconds);
|
||||
else
|
||||
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingMinutes, (int)(seconds / 60), (int)(seconds % 60));
|
||||
this.Refresh();
|
||||
if (_cancel)
|
||||
{
|
||||
process.Kill();
|
||||
progressBar1.Visible = false;
|
||||
labelPleaseWait.Visible = false;
|
||||
buttonRipWave.Enabled = true;
|
||||
targetFile = null;
|
||||
buttonCancel.Visible = false;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds > 1 && Convert.ToInt32(seconds) % 10 == 0 && runningOnWindows)
|
||||
{
|
||||
try
|
||||
{
|
||||
var drive = new DriveInfo("c");
|
||||
if (drive.IsReady)
|
||||
{
|
||||
if (drive.AvailableFreeSpace < 50 * 1000000) // 50 mb
|
||||
{
|
||||
labelInfo.ForeColor = Color.Red;
|
||||
labelInfo.Text = "LOW DISC SPACE!";
|
||||
}
|
||||
else if (labelInfo.ForeColor == Color.Red)
|
||||
{
|
||||
labelInfo.Text = Utilities.FormatBytesToDisplayFileSize(drive.AvailableFreeSpace) + " free";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
buttonCancel.Visible = false;
|
||||
progressBar1.Visible = false;
|
||||
progressBar1.Style = ProgressBarStyle.Blocks;
|
||||
|
||||
if (!File.Exists(targetFile))
|
||||
{
|
||||
if (_encodeParamters != RetryEncodeParameters)
|
||||
{
|
||||
_encodeParamters = RetryEncodeParameters;
|
||||
buttonRipWave_Click(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Could not find extracted wave file! This feature requires VLC media player 1.1.x or newer (" + (IntPtr.Size * 8) + " -bit)." + Environment.NewLine
|
||||
+ Environment.NewLine +
|
||||
"Command line: " + exeFilePath + " " + parameters);
|
||||
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
FileInfo fi = new FileInfo(targetFile);
|
||||
if (fi.Length <= 200)
|
||||
{
|
||||
MessageBox.Show("Sorry! VLC/FFMPEG was unable to extract audio to wave file via this command line:" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Command line: " + exeFilePath + " " + parameters + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Note: Do check free disk space.");
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ReadWaveFile(targetFile, _delayInMilliseconds);
|
||||
labelProgress.Text = string.Empty;
|
||||
File.Delete(targetFile);
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void ReadWaveFile(string targetFile, int delayInMilliseconds)
|
||||
{
|
||||
var waveFile = new WavePeakGenerator(targetFile);
|
||||
|
||||
int sampleRate = Configuration.Settings.VideoControls.WaveFormMininumSampleRate; // Normally 128
|
||||
while (!(waveFile.Header.SampleRate % sampleRate == 0) && sampleRate < 5000)
|
||||
sampleRate++; // old sample-rate / new sample-rate must have rest = 0
|
||||
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingPeakFile;
|
||||
this.Refresh();
|
||||
waveFile.GeneratePeakSamples(sampleRate, delayInMilliseconds); // samples per second - SampleRate
|
||||
|
||||
if (Configuration.Settings.VideoControls.GenerateSpectrogram)
|
||||
{
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingSpectrogram;
|
||||
this.Refresh();
|
||||
System.IO.Directory.CreateDirectory(_spectrogramDirectory);
|
||||
SpectrogramBitmaps = waveFile.GenerateFourierData(256, _spectrogramDirectory, delayInMilliseconds); // image height = nfft / 2
|
||||
}
|
||||
labelPleaseWait.Visible = false;
|
||||
|
||||
WavePeak = waveFile;
|
||||
waveFile.Close();
|
||||
}
|
||||
|
||||
private void AddWareForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
Refresh();
|
||||
var audioTrackNames = new List<string>();
|
||||
var mkvAudioTrackNumbers = new Dictionary<int, int>();
|
||||
int numberOfAudioTracks = 0;
|
||||
if (labelVideoFileName.Text.Length > 1 && File.Exists(labelVideoFileName.Text))
|
||||
{
|
||||
if (labelVideoFileName.Text.ToLower().EndsWith(".mkv"))
|
||||
{ // Choose for number of audio tracks in matroska files
|
||||
try
|
||||
{
|
||||
var mkv = new Matroska(labelVideoFileName.Text);
|
||||
if (mkv.IsValid)
|
||||
{
|
||||
var trackInfo = mkv.GetTrackInfo();
|
||||
foreach (var ti in trackInfo)
|
||||
{
|
||||
if (ti.IsAudio)
|
||||
{
|
||||
numberOfAudioTracks++;
|
||||
if (ti.CodecId != null && ti.Language != null)
|
||||
audioTrackNames.Add("#" + ti.TrackNumber + ": " + ti.CodecId.Replace("\0", string.Empty) + " - " + ti.Language.Replace("\0", string.Empty));
|
||||
else
|
||||
audioTrackNames.Add("#" + ti.TrackNumber.ToString());
|
||||
mkvAudioTrackNumbers.Add(mkvAudioTrackNumbers.Count, ti.TrackNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (labelVideoFileName.Text.ToLower().EndsWith(".mp4") || labelVideoFileName.Text.ToLower().EndsWith(".m4v"))
|
||||
{ // Choose for number of audio tracks in mp4 files
|
||||
try
|
||||
{
|
||||
var mp4 = new Nikse.SubtitleEdit.Logic.Mp4.Mp4Parser(labelVideoFileName.Text);
|
||||
var tracks = mp4.GetAudioTracks();
|
||||
int i=0;
|
||||
foreach (var track in tracks)
|
||||
{
|
||||
i++;
|
||||
if (track.Name != null && track.Mdia != null && track.Mdia.Mdhd != null && track.Mdia.Mdhd.LanguageString != null)
|
||||
audioTrackNames.Add(i + ": " + track.Name + " - " + track.Mdia.Mdhd.LanguageString);
|
||||
else if (track.Name != null)
|
||||
audioTrackNames.Add(i + ": " + track.Name);
|
||||
else
|
||||
audioTrackNames.Add(i.ToString());
|
||||
}
|
||||
numberOfAudioTracks = tracks.Count;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction)
|
||||
{ // don't know how to extract audio number x via FFMPEG...
|
||||
numberOfAudioTracks = 1;
|
||||
_audioTrackNumber = 0;
|
||||
}
|
||||
|
||||
// Choose audio track
|
||||
if (numberOfAudioTracks > 1)
|
||||
{
|
||||
var form = new ChooseAudioTrack(audioTrackNames, _audioTrackNumber);
|
||||
if (form.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
_audioTrackNumber = form.SelectedTrack;
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check for delay in matroska files
|
||||
if (labelVideoFileName.Text.ToLower().EndsWith(".mkv"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var mkv = new Matroska(labelVideoFileName.Text);
|
||||
if (mkv.IsValid)
|
||||
{
|
||||
_delayInMilliseconds = (int)mkv.GetTrackStartTime(mkvAudioTrackNumbers[_audioTrackNumber]);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
_delayInMilliseconds = 0;
|
||||
}
|
||||
}
|
||||
|
||||
buttonRipWave_Click(null, null);
|
||||
}
|
||||
else if (_wavFileName != null)
|
||||
{
|
||||
FixWaveOnly();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddWareForm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
DialogResult = DialogResult.Cancel;
|
||||
else if (e.KeyCode == Keys.F1)
|
||||
{
|
||||
Utilities.ShowHelp("#waveform");
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
_cancel = true;
|
||||
}
|
||||
|
||||
internal void InitializeViaWaveFile(string fileName, string spectrogramFolder)
|
||||
{
|
||||
_wavFileName = fileName;
|
||||
_spectrogramDirectory = spectrogramFolder;
|
||||
}
|
||||
|
||||
private void FixWaveOnly()
|
||||
{
|
||||
Text = Configuration.Settings.Language.AddWaveForm.Title;
|
||||
buttonRipWave.Text = Configuration.Settings.Language.AddWaveForm.GenerateWaveFormData;
|
||||
labelPleaseWait.Text = Configuration.Settings.Language.AddWaveForm.PleaseWait;
|
||||
labelVideoFileName.Text = string.Empty;
|
||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||
buttonRipWave.Enabled = false;
|
||||
_cancel = false;
|
||||
buttonCancel.Visible = false;
|
||||
progressBar1.Visible = false;
|
||||
progressBar1.Style = ProgressBarStyle.Blocks;
|
||||
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingPeakFile;
|
||||
this.Refresh();
|
||||
labelPleaseWait.Visible = false;
|
||||
try
|
||||
{
|
||||
ReadWaveFile(_wavFileName, _delayInMilliseconds);
|
||||
labelProgress.Text = string.Empty;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.Message + Environment.NewLine + exception.StackTrace);
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using Nikse.SubtitleEdit.Logic.VideoFormats;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public sealed partial class AddWaveForm : Form
|
||||
{
|
||||
public string SourceVideoFileName { get; private set; }
|
||||
private bool _cancel = false;
|
||||
private string _wavFileName = null;
|
||||
private string _spectrogramDirectory;
|
||||
public List<Bitmap> SpectrogramBitmaps { get; private set; }
|
||||
private string _encodeParamters;
|
||||
private const string RetryEncodeParameters = "acodec=s16l";
|
||||
private int _audioTrackNumber = -1;
|
||||
private int _delayInMilliseconds = 0;
|
||||
|
||||
public AddWaveForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonCancel.Visible = false;
|
||||
labelInfo.Text = string.Empty;
|
||||
}
|
||||
|
||||
public WavePeakGenerator WavePeak { get; private set; }
|
||||
|
||||
public void Initialize(string videoFile, string spectrogramDirectory, int audioTrackNumber)
|
||||
{
|
||||
_audioTrackNumber = audioTrackNumber;
|
||||
if (_audioTrackNumber < 0)
|
||||
_audioTrackNumber = 0;
|
||||
Text = Configuration.Settings.Language.AddWaveForm.Title;
|
||||
buttonRipWave.Text = Configuration.Settings.Language.AddWaveForm.GenerateWaveFormData;
|
||||
labelPleaseWait.Text = Configuration.Settings.Language.AddWaveForm.PleaseWait;
|
||||
labelVideoFileName.Text = videoFile;
|
||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||
labelSourcevideoFile.Text = Configuration.Settings.Language.AddWaveForm.SourceVideoFile;
|
||||
_spectrogramDirectory = spectrogramDirectory;
|
||||
_encodeParamters = Configuration.Settings.General.VlcWaveTranscodeSettings;
|
||||
}
|
||||
|
||||
private void buttonRipWave_Click(object sender, EventArgs e)
|
||||
{
|
||||
buttonRipWave.Enabled = false;
|
||||
_cancel = false;
|
||||
bool runningOnWindows = false;
|
||||
SourceVideoFileName = labelVideoFileName.Text;
|
||||
string targetFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString() + ".wav");
|
||||
string parameters = "\"" + SourceVideoFileName + "\" -I dummy -vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout=\"#transcode{acodec=s16l,channels=1,ab=128}:std{access=file,mux=wav,dst=" + targetFile + "}\" vlc://quit";
|
||||
// string parameters = "\"" + SourceVideoFileName + "\" -I dummy -vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout=\"#transcode{acodec=s16l,channels=2,ab=128,samplerate=24000}:std{access=file,mux=wav,dst=" + targetFile + "}\" vlc://quit";
|
||||
string exeFilePath;
|
||||
if (Utilities.IsRunningOnLinux() || Utilities.IsRunningOnMac())
|
||||
{
|
||||
exeFilePath = "cvlc";
|
||||
parameters = "-vvv --no-sout-video --audio-track=" + _audioTrackNumber.ToString() + " --sout '#transcode{" + _encodeParamters + "}:std{mux=wav,access=file,dst=" + targetFile + "}' \"" + SourceVideoFileName + "\" vlc://quit";
|
||||
}
|
||||
else // windows
|
||||
{
|
||||
runningOnWindows = true;
|
||||
exeFilePath = Nikse.SubtitleEdit.Logic.VideoPlayers.LibVlc11xDynamic.GetVlcPath("vlc.exe");
|
||||
if (!System.IO.File.Exists(exeFilePath))
|
||||
{
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction && File.Exists(Configuration.Settings.General.FFMPEGLocation))
|
||||
{
|
||||
// We will run FFMPEG
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (MessageBox.Show(Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFound + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
Configuration.Settings.Language.AddWaveForm.GoToVlcMediaPlayerHomePage,
|
||||
Configuration.Settings.Language.AddWaveForm.VlcMediaPlayerNotFoundTitle, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
|
||||
{
|
||||
System.Diagnostics.Process.Start("http://www.videolan.org/");
|
||||
}
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
labelInfo.Text = "VLC";
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction && File.Exists(Configuration.Settings.General.FFMPEGLocation))
|
||||
{
|
||||
string FFMPEGWaveTranscodeSettings = "-i \"{0}\" -vn -ar 24000 -ac 2 -ab 128 -vol 448 -f wav \"{1}\"";
|
||||
//-i indicates the input
|
||||
//-vn means no video ouput
|
||||
//-ar 44100 indicates the sampling frequency.
|
||||
//-ab indicates the bit rate (in this example 160kb/sec)
|
||||
//-vol 448 will boot volume... 256 is normal
|
||||
//-ac 2 means 2 channels
|
||||
|
||||
exeFilePath = Configuration.Settings.General.FFMPEGLocation;
|
||||
parameters = string.Format(FFMPEGWaveTranscodeSettings, SourceVideoFileName, targetFile);
|
||||
labelInfo.Text = "FFMPEG";
|
||||
}
|
||||
|
||||
labelPleaseWait.Visible = true;
|
||||
Process process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo(exeFilePath, parameters);
|
||||
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
process.Start();
|
||||
progressBar1.Style = ProgressBarStyle.Marquee;
|
||||
progressBar1.Visible = true;
|
||||
double seconds = 0;
|
||||
buttonCancel.Visible = true;
|
||||
try
|
||||
{
|
||||
process.PriorityClass = ProcessPriorityClass.Normal;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
while (!process.HasExited)
|
||||
{
|
||||
Application.DoEvents();
|
||||
System.Threading.Thread.Sleep(100);
|
||||
seconds += 0.1;
|
||||
if (seconds < 60)
|
||||
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingSeconds, seconds);
|
||||
else
|
||||
labelProgress.Text = string.Format(Configuration.Settings.Language.AddWaveForm.ExtractingMinutes, (int)(seconds / 60), (int)(seconds % 60));
|
||||
this.Refresh();
|
||||
if (_cancel)
|
||||
{
|
||||
process.Kill();
|
||||
progressBar1.Visible = false;
|
||||
labelPleaseWait.Visible = false;
|
||||
buttonRipWave.Enabled = true;
|
||||
targetFile = null;
|
||||
buttonCancel.Visible = false;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
return;
|
||||
}
|
||||
|
||||
if (seconds > 1 && Convert.ToInt32(seconds) % 10 == 0 && runningOnWindows)
|
||||
{
|
||||
try
|
||||
{
|
||||
var drive = new DriveInfo("c");
|
||||
if (drive.IsReady)
|
||||
{
|
||||
if (drive.AvailableFreeSpace < 50 * 1000000) // 50 mb
|
||||
{
|
||||
labelInfo.ForeColor = Color.Red;
|
||||
labelInfo.Text = "LOW DISC SPACE!";
|
||||
}
|
||||
else if (labelInfo.ForeColor == Color.Red)
|
||||
{
|
||||
labelInfo.Text = Utilities.FormatBytesToDisplayFileSize(drive.AvailableFreeSpace) + " free";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
buttonCancel.Visible = false;
|
||||
progressBar1.Visible = false;
|
||||
progressBar1.Style = ProgressBarStyle.Blocks;
|
||||
|
||||
if (!File.Exists(targetFile))
|
||||
{
|
||||
if (_encodeParamters != RetryEncodeParameters)
|
||||
{
|
||||
_encodeParamters = RetryEncodeParameters;
|
||||
buttonRipWave_Click(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
MessageBox.Show("Could not find extracted wave file! This feature requires VLC media player 1.1.x or newer (" + (IntPtr.Size * 8) + " -bit)." + Environment.NewLine
|
||||
+ Environment.NewLine +
|
||||
"Command line: " + exeFilePath + " " + parameters);
|
||||
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
FileInfo fi = new FileInfo(targetFile);
|
||||
if (fi.Length <= 200)
|
||||
{
|
||||
MessageBox.Show("Sorry! VLC/FFMPEG was unable to extract audio to wave file via this command line:" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Command line: " + exeFilePath + " " + parameters + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Note: Do check free disk space.");
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonRipWave.Enabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ReadWaveFile(targetFile, _delayInMilliseconds);
|
||||
labelProgress.Text = string.Empty;
|
||||
File.Delete(targetFile);
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void ReadWaveFile(string targetFile, int delayInMilliseconds)
|
||||
{
|
||||
var waveFile = new WavePeakGenerator(targetFile);
|
||||
|
||||
int sampleRate = Configuration.Settings.VideoControls.WaveFormMininumSampleRate; // Normally 128
|
||||
while (!(waveFile.Header.SampleRate % sampleRate == 0) && sampleRate < 5000)
|
||||
sampleRate++; // old sample-rate / new sample-rate must have rest = 0
|
||||
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingPeakFile;
|
||||
this.Refresh();
|
||||
waveFile.GeneratePeakSamples(sampleRate, delayInMilliseconds); // samples per second - SampleRate
|
||||
|
||||
if (Configuration.Settings.VideoControls.GenerateSpectrogram)
|
||||
{
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingSpectrogram;
|
||||
this.Refresh();
|
||||
System.IO.Directory.CreateDirectory(_spectrogramDirectory);
|
||||
SpectrogramBitmaps = waveFile.GenerateFourierData(256, _spectrogramDirectory, delayInMilliseconds); // image height = nfft / 2
|
||||
}
|
||||
labelPleaseWait.Visible = false;
|
||||
|
||||
WavePeak = waveFile;
|
||||
waveFile.Close();
|
||||
}
|
||||
|
||||
private void AddWareForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
Refresh();
|
||||
var audioTrackNames = new List<string>();
|
||||
var mkvAudioTrackNumbers = new Dictionary<int, int>();
|
||||
int numberOfAudioTracks = 0;
|
||||
if (labelVideoFileName.Text.Length > 1 && File.Exists(labelVideoFileName.Text))
|
||||
{
|
||||
if (labelVideoFileName.Text.ToLower().EndsWith(".mkv"))
|
||||
{ // Choose for number of audio tracks in matroska files
|
||||
try
|
||||
{
|
||||
var mkv = new Matroska(labelVideoFileName.Text);
|
||||
if (mkv.IsValid)
|
||||
{
|
||||
var trackInfo = mkv.GetTrackInfo();
|
||||
foreach (var ti in trackInfo)
|
||||
{
|
||||
if (ti.IsAudio)
|
||||
{
|
||||
numberOfAudioTracks++;
|
||||
if (ti.CodecId != null && ti.Language != null)
|
||||
audioTrackNames.Add("#" + ti.TrackNumber + ": " + ti.CodecId.Replace("\0", string.Empty) + " - " + ti.Language.Replace("\0", string.Empty));
|
||||
else
|
||||
audioTrackNames.Add("#" + ti.TrackNumber.ToString());
|
||||
mkvAudioTrackNumbers.Add(mkvAudioTrackNumbers.Count, ti.TrackNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (labelVideoFileName.Text.ToLower().EndsWith(".mp4") || labelVideoFileName.Text.ToLower().EndsWith(".m4v"))
|
||||
{ // Choose for number of audio tracks in mp4 files
|
||||
try
|
||||
{
|
||||
var mp4 = new Nikse.SubtitleEdit.Logic.Mp4.Mp4Parser(labelVideoFileName.Text);
|
||||
var tracks = mp4.GetAudioTracks();
|
||||
int i=0;
|
||||
foreach (var track in tracks)
|
||||
{
|
||||
i++;
|
||||
if (track.Name != null && track.Mdia != null && track.Mdia.Mdhd != null && track.Mdia.Mdhd.LanguageString != null)
|
||||
audioTrackNames.Add(i + ": " + track.Name + " - " + track.Mdia.Mdhd.LanguageString);
|
||||
else if (track.Name != null)
|
||||
audioTrackNames.Add(i + ": " + track.Name);
|
||||
else
|
||||
audioTrackNames.Add(i.ToString());
|
||||
}
|
||||
numberOfAudioTracks = tracks.Count;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration.Settings.General.UseFFMPEGForWaveExtraction)
|
||||
{ // don't know how to extract audio number x via FFMPEG...
|
||||
numberOfAudioTracks = 1;
|
||||
_audioTrackNumber = 0;
|
||||
}
|
||||
|
||||
// Choose audio track
|
||||
if (numberOfAudioTracks > 1)
|
||||
{
|
||||
var form = new ChooseAudioTrack(audioTrackNames, _audioTrackNumber);
|
||||
if (form.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
_audioTrackNumber = form.SelectedTrack;
|
||||
}
|
||||
else
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// check for delay in matroska files
|
||||
if (labelVideoFileName.Text.ToLower().EndsWith(".mkv"))
|
||||
{
|
||||
try
|
||||
{
|
||||
var mkv = new Matroska(labelVideoFileName.Text);
|
||||
if (mkv.IsValid)
|
||||
{
|
||||
_delayInMilliseconds = (int)mkv.GetTrackStartTime(mkvAudioTrackNumbers[_audioTrackNumber]);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
_delayInMilliseconds = 0;
|
||||
}
|
||||
}
|
||||
|
||||
buttonRipWave_Click(null, null);
|
||||
}
|
||||
else if (_wavFileName != null)
|
||||
{
|
||||
FixWaveOnly();
|
||||
}
|
||||
}
|
||||
|
||||
private void AddWareForm_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
DialogResult = DialogResult.Cancel;
|
||||
else if (e.KeyCode == Keys.F1)
|
||||
{
|
||||
Utilities.ShowHelp("#waveform");
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
_cancel = true;
|
||||
}
|
||||
|
||||
internal void InitializeViaWaveFile(string fileName, string spectrogramFolder)
|
||||
{
|
||||
_wavFileName = fileName;
|
||||
_spectrogramDirectory = spectrogramFolder;
|
||||
}
|
||||
|
||||
private void FixWaveOnly()
|
||||
{
|
||||
Text = Configuration.Settings.Language.AddWaveForm.Title;
|
||||
buttonRipWave.Text = Configuration.Settings.Language.AddWaveForm.GenerateWaveFormData;
|
||||
labelPleaseWait.Text = Configuration.Settings.Language.AddWaveForm.PleaseWait;
|
||||
labelVideoFileName.Text = string.Empty;
|
||||
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
|
||||
buttonRipWave.Enabled = false;
|
||||
_cancel = false;
|
||||
buttonCancel.Visible = false;
|
||||
progressBar1.Visible = false;
|
||||
progressBar1.Style = ProgressBarStyle.Blocks;
|
||||
|
||||
labelProgress.Text = Configuration.Settings.Language.AddWaveForm.GeneratingPeakFile;
|
||||
this.Refresh();
|
||||
labelPleaseWait.Visible = false;
|
||||
try
|
||||
{
|
||||
ReadWaveFile(_wavFileName, _delayInMilliseconds);
|
||||
labelProgress.Text = string.Empty;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
MessageBox.Show(exception.Message + Environment.NewLine + exception.StackTrace);
|
||||
this.DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,123 +1,123 @@
|
||||
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@ -120,9 +120,17 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private void ChangeLanguage_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.L)
|
||||
{
|
||||
Configuration.Settings.Language.Save();
|
||||
}
|
||||
else if (e.Shift && e.Control && e.Alt && e.KeyCode == Keys.C)
|
||||
{
|
||||
XmlDeserializerGenerator.GenerateCSharpXmlDeserializerForLanguageStructure();
|
||||
}
|
||||
else if (e.KeyCode == Keys.F1)
|
||||
{
|
||||
Utilities.ShowHelp("#translate");
|
||||
|
@ -19,8 +19,8 @@ namespace Nikse.SubtitleEdit
|
||||
|
||||
Text = Configuration.Settings.Language.Settings.UseDoNotBreakAfterList;
|
||||
labelLanguage.Text = Configuration.Settings.Language.ChooseLanguage.Language;
|
||||
buttonRemoveNoBreakAfter.Text = Configuration.Settings.Language.DvdSubrip.Remove;
|
||||
buttonAddNoBreakAfter.Text = Configuration.Settings.Language.DvdSubrip.Add;
|
||||
buttonRemoveNoBreakAfter.Text = Configuration.Settings.Language.DvdSubRip.Remove;
|
||||
buttonAddNoBreakAfter.Text = Configuration.Settings.Language.DvdSubRip.Add;
|
||||
radioButtonText.Text = Configuration.Settings.Language.General.Text;
|
||||
radioButtonRegEx.Text = Configuration.Settings.Language.MultipleReplace.RegularExpression;
|
||||
buttonOK.Text = Configuration.Settings.Language.General.OK;
|
||||
|
@ -37,7 +37,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
labelStatus.Text = string.Empty;
|
||||
buttonStartRipping.Enabled = false;
|
||||
|
||||
_language = Configuration.Settings.Language.DvdSubrip;
|
||||
_language = Configuration.Settings.Language.DvdSubRip;
|
||||
Text = _language.Title;
|
||||
groupBoxDvd.Text = _language.DvdGroupTitle;
|
||||
labelIfoFile.Text = _language.IfoFile;
|
||||
|
@ -25,9 +25,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
listViewParts.Columns[2].Text = Configuration.Settings.Language.JoinSubtitles.EndTime;
|
||||
listViewParts.Columns[3].Text = Configuration.Settings.Language.JoinSubtitles.FileName;
|
||||
|
||||
buttonAddVobFile.Text = Configuration.Settings.Language.DvdSubrip.Add;
|
||||
ButtonRemoveVob.Text = Configuration.Settings.Language.DvdSubrip.Remove;
|
||||
buttonClear.Text = Configuration.Settings.Language.DvdSubrip.Clear;
|
||||
buttonAddVobFile.Text = Configuration.Settings.Language.DvdSubRip.Add;
|
||||
ButtonRemoveVob.Text = Configuration.Settings.Language.DvdSubRip.Remove;
|
||||
buttonClear.Text = Configuration.Settings.Language.DvdSubRip.Clear;
|
||||
|
||||
Text = Configuration.Settings.Language.JoinSubtitles.Title;
|
||||
groupBoxPreview.Text = Configuration.Settings.Language.JoinSubtitles.Information;
|
||||
|
@ -11932,9 +11932,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
var reader = new System.IO.StreamReader(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
|
||||
Configuration.Settings.Language = Language.Load(reader);
|
||||
reader.Close();
|
||||
Configuration.Settings.Language = Language.Load(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
|
||||
|
||||
//var reader = new System.IO.StreamReader(Path.Combine(Configuration.BaseDirectory, "Languages") + Path.DirectorySeparatorChar + cultureName + ".xml");
|
||||
//Configuration.Settings.Language = Language.Load(reader);
|
||||
//reader.Close();
|
||||
}
|
||||
Configuration.Settings.General.Language = cultureName;
|
||||
_languageGeneral = Configuration.Settings.Language.General;
|
||||
@ -15014,7 +15016,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (mediaPlayer != null)
|
||||
mediaPlayer.Pause();
|
||||
var addWaveForm = new AddWareForm();
|
||||
var addWaveForm = new AddWaveForm();
|
||||
string peakWaveFileName = GetPeakWaveFileName(_videoFileName);
|
||||
string spectrogramFolder = GetSpectrogramFolder(_videoFileName);
|
||||
addWaveForm.Initialize(_videoFileName, spectrogramFolder, _videoAudioTrackNumber);
|
||||
@ -15384,7 +15386,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
var addWaveForm = new AddWareForm();
|
||||
var addWaveForm = new AddWaveForm();
|
||||
string spectrogramFolder = GetSpectrogramFolder(_videoFileName);
|
||||
addWaveForm.InitializeViaWaveFile(fileName, spectrogramFolder);
|
||||
if (addWaveForm.ShowDialog() == DialogResult.OK)
|
||||
|
@ -58,8 +58,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
splitContainer1.Panel1MinSize = 200;
|
||||
splitContainer1.Panel2MinSize = 200;
|
||||
|
||||
moveUpToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.MoveUp;
|
||||
moveDownToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.MoveDown;
|
||||
moveUpToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.MoveUp;
|
||||
moveDownToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.MoveDown;
|
||||
|
||||
radioButtonCaseSensitive.Left = radioButtonNormal.Left + radioButtonNormal.Width + 40;
|
||||
radioButtonRegEx.Left = radioButtonCaseSensitive.Left + radioButtonCaseSensitive.Width + 40;
|
||||
|
@ -429,9 +429,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
bDNXMLToolStripMenuItem.Text = Configuration.Settings.Language.Main.Menu.File.ExportBdnXml;
|
||||
bluraySupToolStripMenuItem.Text = Configuration.Settings.Language.Main.Menu.File.ExportBluRaySup;
|
||||
|
||||
toolStripMenuItemClearFixes.Text = Configuration.Settings.Language.DvdSubrip.Clear;
|
||||
toolStripMenuItemClearGuesses.Text = Configuration.Settings.Language.DvdSubrip.Clear;
|
||||
clearToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubrip.Clear;
|
||||
toolStripMenuItemClearFixes.Text = Configuration.Settings.Language.DvdSubRip.Clear;
|
||||
toolStripMenuItemClearGuesses.Text = Configuration.Settings.Language.DvdSubRip.Clear;
|
||||
clearToolStripMenuItem.Text = Configuration.Settings.Language.DvdSubRip.Clear;
|
||||
|
||||
checkBoxNOcrCorrect.Checked = Configuration.Settings.VobSubOcr.LineOcrDraw;
|
||||
checkBoxNOcrItalic.Checked = Configuration.Settings.VobSubOcr.LineOcrAdvancedItalic;
|
||||
|
@ -289,7 +289,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ChooseColor>
|
||||
</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>ifo/vobs (DVD) نسخ الترجمات من</Title>
|
||||
<DvdGroupTitle>معلومات / DVD ملفات</DvdGroupTitle>
|
||||
<IfoFile>IFO ملف</IfoFile>
|
||||
@ -310,7 +310,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>قراءة بيانات الترجمة</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>نسخ vob file {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO وليس '{0}' النوع 'DVDVIDEO-VTS'.{1}محاولة أخرى من ملف {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>اختيار اللغة</Title>
|
||||
<ChooseLanguageStreamId>اختيار اللغة</ChooseLanguageStreamId>
|
||||
|
@ -254,7 +254,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Text anterior pren tot el temps buit</ProlongEndTime>
|
||||
<DivideEven>Temps buit dividit entre texts</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Extreu subtítols des de IFO/VOB (DVD)</Title>
|
||||
<DvdGroupTitle>Info fitxers DVD</DvdGroupTitle>
|
||||
<IfoFile>Fitxer IFO</IfoFile>
|
||||
@ -275,7 +275,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Llegint dades subtítol...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Extraient fitxer vob {1} de {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO és '{0}' i no 'DVDVIDEO-VTS'.{1} Intenta amb altre fitxer {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Escolliu idioma</Title>
|
||||
<ChooseLanguageStreamId>Escolliu idioma (flux-id)</ChooseLanguageStreamId>
|
||||
|
@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Předchozí text zabere celý čas mezery</ProlongEndTime>
|
||||
<DivideEven>Texty si rozdělí čas mezery</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Vytáhnout titulky z souborů ifo/vob (DVD)</Title>
|
||||
<DvdGroupTitle>DVD soubory/info</DvdGroupTitle>
|
||||
<IfoFile>Soubor IFO</IfoFile>
|
||||
@ -303,7 +303,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Čtení dat titulků...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Vytahování souboru vob {1} z {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Typ IFO je '{0}' a ne 'DVDVIDEO-VTS'.{1}Zkuste jiný soubor než {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Vybrat jazyk</Title>
|
||||
<ChooseLanguageStreamId>Vyberte jazyk (ID stopy)</ChooseLanguageStreamId>
|
||||
|
@ -283,7 +283,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Forrige tekst tager alle tiden</ProlongEndTime>
|
||||
<DivideEven>Tid deles</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Rip undertekster fra ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>DVD-filer/info</DvdGroupTitle>
|
||||
<IfoFile>IFO fil</IfoFile>
|
||||
@ -304,7 +304,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Læser undertekst data...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripper vob fil {1} af {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO type er '{0}' og ikke 'DVD video-VTS «. {1} Prøv en anden fil end {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Vælg sprog</Title>
|
||||
<ChooseLanguageStreamId>Vælg sprog (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -282,7 +282,7 @@ E-Mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Vorheriger Text nutzt Abstandszeit</ProlongEndTime>
|
||||
<DivideEven>Texte teilen Abstandszeit</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Untertitel aus DVD (IFO/VOB) extrahieren</Title>
|
||||
<DvdGroupTitle>DVD Dateien/Info</DvdGroupTitle>
|
||||
<IfoFile>IFO Datei</IfoFile>
|
||||
@ -303,7 +303,7 @@ E-Mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Lese Untertiteldaten...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Verarbeite VOB Datei {1} von {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO Typ ist '{0}' und nicht 'DVD VIDEO VTS'. {1}Eine andere Datei versuchen als {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Sprache auswählen</Title>
|
||||
<ChooseLanguageStreamId>Sprache auswählen (Spur ID)</ChooseLanguageStreamId>
|
||||
|
@ -160,7 +160,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ShowOnlyDifferences>Εμφάνιση μόνο διαφορών</ShowOnlyDifferences>
|
||||
<OnlyLookForDifferencesInText>Αναζήτηση μόνο για διαφορές στο κείμενο</OnlyLookForDifferencesInText>
|
||||
</CompareSubtitles>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Αντιγράψτε υπότιτλους από IFO/VOB (DVD)</Title>
|
||||
<DvdGroupTitle>DVD αρχεία/πληροφορίες</DvdGroupTitle>
|
||||
<IfoFile>Αρχεία IFO</IfoFile>
|
||||
@ -181,7 +181,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Ανάγνωση δεδομένων υπότιτλου...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Αντιγραφή αρχείου VOB {1} από {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Ο τύπος του IFO είναι '{0}' και όχι 'DVDVIDEO-VTS'.{1}Δοκιμάστε ένα άλλο αρχείο αντί του {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Επιλέξτε γλώσσα</Title>
|
||||
<ChooseLanguageStreamId>Επιλέξτε γλώσσα (id-ροής)</ChooseLanguageStreamId>
|
||||
|
@ -261,7 +261,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Texto anterior se lleva todo el tiempo brecha</ProlongEndTime>
|
||||
<DivideEven>Textos divide el tiempo brecha</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
|
||||
<IfoFile>Archivo IFO</IfoFile>
|
||||
@ -282,7 +282,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Seleccionar idioma</Title>
|
||||
<ChooseLanguageStreamId>Seleccione idioma (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -159,7 +159,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ShowOnlyDifferences>Mostrar solo diferencias</ShowOnlyDifferences>
|
||||
<OnlyLookForDifferencesInText>Buscar solo diferencias en el texto</OnlyLookForDifferencesInText>
|
||||
</CompareSubtitles>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
|
||||
<IfoFile>Archivo IFO</IfoFile>
|
||||
@ -180,7 +180,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Seleccionar idioma</Title>
|
||||
<ChooseLanguageStreamId>Seleccioneidioma (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -273,7 +273,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>El texto anterior lleva todo el intervalo de tiempo</ProlongEndTime>
|
||||
<DivideEven>El texto divide el intervalo de tiempo</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Ripear subtítulos de ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>DVD archivos/info</DvdGroupTitle>
|
||||
<IfoFile>Archivo IFO</IfoFile>
|
||||
@ -294,7 +294,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Leyendo datos del subtítulo...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripeando archivo vob {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>El tipo IFO es '{0}' en lugar de 'DVDVIDEO-VTS'.{1}Pruebe con otro archivo que {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Seleccionar idioma</Title>
|
||||
<ChooseLanguageStreamId>Seleccioneidioma (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -262,7 +262,7 @@ Post@: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Aurreko idazkiak hutsarte denbora guztia hartzen du</ProlongEndTime>
|
||||
<DivideEven>Idazkiak hutsarte denbora zatitzen du</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Grabatu ifo/vob azpidatziak (dvd)-tik</Title>
|
||||
<DvdGroupTitle>DVD agiri/argibideak</DvdGroupTitle>
|
||||
<IfoFile>IFO agiria</IfoFile>
|
||||
@ -283,7 +283,7 @@ Post@: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Azpidatzi datuak irakurtzen...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Vob agiria grabatzen {1} {2}-tik: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO mota da '{0}' eta ez 'DVDVIDEO-VTS'. {1} Saiatu beste agiri batekin {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Hautatu hizkuntza</Title>
|
||||
<ChooseLanguageStreamId>Hautatu hizkuntza (Jario-ezaug.)</ChooseLanguageStreamId>
|
||||
|
@ -160,7 +160,7 @@ http://soft98.ir
|
||||
<ShowOnlyDifferences>فقط تفاوت ها را نمایش بده</ShowOnlyDifferences>
|
||||
<OnlyLookForDifferencesInText>فقط برای تفاوت های موجود در متن نگاه کن</OnlyLookForDifferencesInText>
|
||||
</CompareSubtitles>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>ifo/vobs (DVD)تبدیل زیرنویسها از</Title>
|
||||
<DvdGroupTitle>فایلها/اطلاعات دی وی دی</DvdGroupTitle>
|
||||
<IfoFile>IFO فایل</IfoFile>
|
||||
@ -181,7 +181,7 @@ http://soft98.ir
|
||||
<ReadingSubtitleData>در حال خواندن اطلاعات</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripping vob file {1} of {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>نوعIFO '{0}' است و نه'DVDVIDEO-VTS'.{1}فایل دیگری را امتحان کنید {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>زبان را انتخاب کنید</Title>
|
||||
<ChooseLanguageStreamId>زبان را انتخاب کنید (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -226,7 +226,7 @@ Haluatko mennä VLC media playerin kotisivulle?
|
||||
<FontSize>Koko</FontSize>
|
||||
<ChooseColor>Valitse väri...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Rippaa tekstitys ifo/vobs-tiedostoista (dvd)</Title>
|
||||
<DvdGroupTitle>DVD tiedostot/tiedot</DvdGroupTitle>
|
||||
<IfoFile>IFO-tiedosto</IfoFile>
|
||||
@ -247,7 +247,7 @@ Haluatko mennä VLC media playerin kotisivulle?
|
||||
<ReadingSubtitleData>Luetaan tekstityksen tietoja...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripataan vob tiedosto {1} / {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO-tyyppi on '{0}' eikä 'DVDVIDEO-VTS'.{1}Valitse muu tiedosto kuin {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Valitse kieli</Title>
|
||||
<ChooseLanguageStreamId>Valitse kieli (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -253,7 +253,7 @@ E-pošta:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Prethodni tekst uzima sve vremenski razmak</ProlongEndTime>
|
||||
<DivideEven>Tekstovi dijeli vremenski razmak</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Vađenje DVD podnaslova</Title>
|
||||
<DvdGroupTitle>Datoteke DVD-a</DvdGroupTitle>
|
||||
<IfoFile>IFO</IfoFile>
|
||||
@ -274,7 +274,7 @@ E-pošta:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Učitavam Podnaslov</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Izvlačim VOB datoteke… ({1} od {2}): {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO je pogrešne vrste. {1}Izaberite drugu datoteku.</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Odabir jezika</Title>
|
||||
<ChooseLanguageStreamId>Izaberite željeni jezik ispod:</ChooseLanguageStreamId>
|
||||
|
@ -253,7 +253,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Previous text takes all gap time</ProlongEndTime>
|
||||
<DivideEven>Texts divides gap time</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Feliratok rippelése ifo/vob fájlokból (dvd)</Title>
|
||||
<DvdGroupTitle>DVD fájlok/információ</DvdGroupTitle>
|
||||
<IfoFile>IFO fájl</IfoFile>
|
||||
@ -274,7 +274,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Felirat adat olvasás...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>{1} - {2} vob fájl rippelése: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>'{0}' IFO típus és nem 'DVDVIDEO-VTS'.{1}Próbáljon másik fájlt, mint {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Válasszon nyelvet</Title>
|
||||
<ChooseLanguageStreamId>Válasszon nyelvet (adatfolyam-azonosító)</ChooseLanguageStreamId>
|
||||
|
@ -262,7 +262,7 @@
|
||||
<ProlongEndTime>Il testo precedente prende tutto il tempo di vuoto</ProlongEndTime>
|
||||
<DivideEven>I testi si suddividono il tempo vuoto </DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Estrazione sottotitoli da ifo/vob (DVD)</Title>
|
||||
<DvdGroupTitle>File DVD/info</DvdGroupTitle>
|
||||
<IfoFile>File IFO</IfoFile>
|
||||
@ -283,7 +283,7 @@
|
||||
<ReadingSubtitleData>Lettura informazioni sottotitoli...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Estrazione file vob {1} di {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Il tipo IFO è '{0}' e non 'DVDVIDEO-VTS'.{1}Prova un altro file di {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Scegli lingua</Title>
|
||||
<ChooseLanguageStreamId>Scegli lingua (ID del flusso)</ChooseLanguageStreamId>
|
||||
|
@ -225,7 +225,7 @@ C# ソース コードは https://github.com/SubtitleEdit/subtitleedit にあり
|
||||
<FontSize>サイズ</FontSize>
|
||||
<ChooseColor>色の選択...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>ifo/vob (DVD) から字幕を抽出</Title>
|
||||
<DvdGroupTitle>DVD ファイル/情報</DvdGroupTitle>
|
||||
<IfoFile>IFO ファイル</IfoFile>
|
||||
@ -246,7 +246,7 @@ C# ソース コードは https://github.com/SubtitleEdit/subtitleedit にあり
|
||||
<ReadingSubtitleData>字幕データを読み取っています...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>{2} の vob ファイル {1} を抽出中: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO の種類が '{0}' で 'DVDVIDEO-VTS' ではありません.{1}{2} 以上のファイルで試行してください</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>言語の選択</Title>
|
||||
<ChooseLanguageStreamId>言語の選択 (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -280,7 +280,7 @@ C# 코드는 https://github.com/SubtitleEdit/subtitleedit 에 있습니다.
|
||||
<ProlongEndTime>이전 텍스트로 시간 간격 메움</ProlongEndTime>
|
||||
<DivideEven>텍스트로 시간 간격을 공유</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>DVD(ifo/vob)에서 자막 가져오기</Title>
|
||||
<DvdGroupTitle>DVD 파일/정보</DvdGroupTitle>
|
||||
<IfoFile>IFO 파일</IfoFile>
|
||||
@ -301,7 +301,7 @@ C# 코드는 https://github.com/SubtitleEdit/subtitleedit 에 있습니다.
|
||||
<ReadingSubtitleData>자막 데이터를 읽는 중...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>{2}개의 Vob 중 {1}번째 추출 중.../ 현재 파일: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>이 IFO의 형식은 '{0}'입니다. 'DVDVideo-VTS'가 아닙니다. {2}가 아닌 다른 파일로 {1}시도해 주십시오!</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>언어 선택</Title>
|
||||
<ChooseLanguageStreamId>언어 선택 (스트림 ID)</ChooseLanguageStreamId>
|
||||
|
@ -262,7 +262,7 @@ Suggesties zijn van harte welkom
|
||||
<ProlongEndTime>Eerdere tekst gebruikt de gehele hiaattijd.</ProlongEndTime>
|
||||
<DivideEven>Tekst verdeeld hiaattijd</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Rip ondertitels van ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>dvd-bestanden/info</DvdGroupTitle>
|
||||
<IfoFile>IFO-bestand</IfoFile>
|
||||
@ -283,7 +283,7 @@ Suggesties zijn van harte welkom
|
||||
<ReadingSubtitleData>Lezen ondertitel data...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Rippen vob-bestand {1} van {2}:. {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO type is '{0}' en niet 'DVDVIDEO-VTS' {1} Probeer dan een ander bestand {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Kies taal</Title>
|
||||
<ChooseLanguageStreamId>Kies taal (stroom-id)</ChooseLanguageStreamId>
|
||||
|
@ -283,7 +283,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Poprzedni tekst widoczny przez cały czas trwania odstępu</ProlongEndTime>
|
||||
<DivideEven>Teksty rozdzielane są czasem trwania odstępu</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Przechwyt napisów z ifo/vob (dvd)</Title>
|
||||
<DvdGroupTitle>Pliki/info DVD</DvdGroupTitle>
|
||||
<IfoFile>Plik IFO</IfoFile>
|
||||
@ -304,7 +304,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Odczyt danych napisów...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Odczyt z pliku VOB {1} z {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Typ IFO '{0} i nie jest to 'DVDVideo-VTS'. {1} Spróbuj wybrać inny plik zamiast {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Wybór języka</Title>
|
||||
<ChooseLanguageStreamId>Wybierz język (strumień-id)</ChooseLanguageStreamId>
|
||||
|
@ -265,7 +265,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Texto anterior assume todo o intervalo</ProlongEndTime>
|
||||
<DivideEven>Texto divide o intervalo</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Ripar legendas de IFO/VOBs (DVD)</Title>
|
||||
<DvdGroupTitle>Arquivos DVD/info</DvdGroupTitle>
|
||||
<IfoFile>Arquivo IFO</IfoFile>
|
||||
@ -286,7 +286,7 @@ E-mail: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Lendo dados da legenda...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Ripando arquivo VOB {1} de {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>O tipo IFO é '{0}' e não 'DVDVIDEO-VTS'.{1}Tente outro arquivo que {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Selecionar idioma</Title>
|
||||
<ChooseLanguageStreamId>Selecionar idioma (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -284,7 +284,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ProlongEndTime>Texto anterior com todos os tempos de intervalo</ProlongEndTime>
|
||||
<DivideEven>Texto divide o tempo do intervalo</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Extrair legendas de IFO/VOBs (DVD)</Title>
|
||||
<DvdGroupTitle>Ficheiro DVD/info</DvdGroupTitle>
|
||||
<IfoFile>Ficheiro IFO</IfoFile>
|
||||
@ -305,7 +305,7 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>A ler dados da legenda...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Extrair ficheiro VOB {1} de {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>O tipo IFO é '{0}' e não 'DVDVIDEO-VTS'.{1}Tentar outro ficheiro que {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Seleccionar idioma</Title>
|
||||
<ChooseLanguageStreamId>Seleccionar idioma (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -224,7 +224,7 @@ E-mail: nikse.dk @gmail.com</AboutText1>
|
||||
<FontSize>Marime</FontSize>
|
||||
<ChooseColor>Alege culoare</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Extrage subtitrare din IFO/vobs (DVD)</Title>
|
||||
<DvdGroupTitle>Fisiere DVD/info</DvdGroupTitle>
|
||||
<IfoFile>Fisier IFO</IfoFile>
|
||||
@ -245,7 +245,7 @@ E-mail: nikse.dk @gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Citeste datele subtitrarii...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Extrage fisier VOB {1} din {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Tipul IFO este '{0}'si nu "DVDVIDEO -VTS'. {1}Incearca alt fisier decat {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Alege limba</Title>
|
||||
<ChooseLanguageStreamId>Alege limba (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -158,7 +158,7 @@
|
||||
<ShowOnlyDifferences>П&рикажи само разлике</ShowOnlyDifferences>
|
||||
<OnlyLookForDifferencesInText>&Тражи само разлике у тексту</OnlyLookForDifferencesInText>
|
||||
</CompareSubtitles>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Вађење ДВД титла</Title>
|
||||
<DvdGroupTitle>Датотеке ДВД-ја</DvdGroupTitle>
|
||||
<IfoFile>IFO</IfoFile>
|
||||
@ -179,7 +179,7 @@
|
||||
<ReadingSubtitleData>Учитавам титл…</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Извршавам VOB датотеку… ({1} од {2}): {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO је погрешне врсте. {1}Изаберите другу датотеку.</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Одабир језика</Title>
|
||||
<ChooseLanguageStreamId>Изаберите жељени језик испод:</ChooseLanguageStreamId>
|
||||
|
@ -225,7 +225,7 @@ E-pošta:mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<FontSize>Veličina Fonta</FontSize>
|
||||
<ChooseColor>Odaberite boju...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Vađenje DVD prevoda</Title>
|
||||
<DvdGroupTitle>Datoteke DVD-a</DvdGroupTitle>
|
||||
<IfoFile>IFO</IfoFile>
|
||||
@ -246,7 +246,7 @@ E-pošta:mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Učitavam prevod</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Izvlačim VOB datoteke… ({1} od {2}): {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO je pogrešne vrste. {1}Izaberite drugu datoteku.</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Biranje jezika</Title>
|
||||
<ChooseLanguageStreamId>Izaberite željeni jezik ispod:</ChooseLanguageStreamId>
|
||||
|
@ -226,7 +226,7 @@ E-post: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<FontSize>Storlek</FontSize>
|
||||
<ChooseColor>Välj färg</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Rippa text från Ifo/vobs (DVD)</Title>
|
||||
<DvdGroupTitle>DVD-fil/info</DvdGroupTitle>
|
||||
<IfoFile>IFO-fil</IfoFile>
|
||||
@ -247,7 +247,7 @@ E-post: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Läs text data</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Rippa VOB-fil {1} av {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO typ '{0}' och inte 'DVD-video VTS'. {1} Försök med en annan fil än {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Välj språk</Title>
|
||||
<ChooseLanguageStreamId>Välj språk (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -226,7 +226,7 @@ E-posta: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<FontSize>Boyur</FontSize>
|
||||
<ChooseColor>Renk seç...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Ifo/vobs (dvd) dosyasından altyazı riple</Title>
|
||||
<DvdGroupTitle>DVD dosyaları/bilgi</DvdGroupTitle>
|
||||
<IfoFile>IFO dosyası</IfoFile>
|
||||
@ -247,7 +247,7 @@ E-posta: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<ReadingSubtitleData>Altyazı verisi okunuyor...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Vob dosyası ripleniyor {1} / {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO type is '{0}' and not 'DVDVIDEO-VTS'.{1}Try another file than {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Dil seç</Title>
|
||||
<ChooseLanguageStreamId>Dil seç (stream-id)</ChooseLanguageStreamId>
|
||||
|
@ -242,7 +242,7 @@ Rất hân hạnh được chào đón.
|
||||
<FontSize>Kích thước</FontSize>
|
||||
<ChooseColor>Chọn màusắc ...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>Trích xuất phụ đề từ ifo/vobs (dvd)</Title>
|
||||
<DvdGroupTitle>Tập tin DVD/Thông tin</DvdGroupTitle>
|
||||
<IfoFile>Tập tin IFO</IfoFile>
|
||||
@ -263,7 +263,7 @@ Rất hân hạnh được chào đón.
|
||||
<ReadingSubtitleData>Đọc dữ liệu phụ đề...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>Trích xuất tập tin vob {1} của {2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>Loại IFO là '{0}' và không phải 'DVDVIDEO-VTS' {1} Hãy thử một tập tin khác {2}.</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>Chọn ngôn ngữ</Title>
|
||||
<ChooseLanguageStreamId>Chọn ngôn ngữ (dòng-id)</ChooseLanguageStreamId>
|
||||
|
@ -264,7 +264,7 @@ C# 源代码可从 https://github.com/SubtitleEdit/subtitleedit 获得。
|
||||
<ProlongEndTime>间隔时间分配给前一行</ProlongEndTime>
|
||||
<DivideEven>间隔时间均分给前后两行</DivideEven>
|
||||
</DurationsBridgeGaps>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>从 DVD 中提取字幕</Title>
|
||||
<DvdGroupTitle>DVD 文件/信息</DvdGroupTitle>
|
||||
<IfoFile>IFO 文件</IfoFile>
|
||||
@ -285,7 +285,7 @@ C# 源代码可从 https://github.com/SubtitleEdit/subtitleedit 获得。
|
||||
<ReadingSubtitleData>正在读取字幕数据...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>正在提取 VOB 文件 {1}/{2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO 类型是 '{0}' 而不是 'DVDVIDEO-VTS'。{1}请尝试其它文件而不是 {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>选择语言</Title>
|
||||
<ChooseLanguageStreamId>选择语言 (流 ID)</ChooseLanguageStreamId>
|
||||
|
@ -224,7 +224,7 @@ C# 原始碼可從 https://github.com/SubtitleEdit/subtitleedit 獲得。
|
||||
<FontSize>大小</FontSize>
|
||||
<ChooseColor>選取彩色...</ChooseColor>
|
||||
</DCinemaProperties>
|
||||
<DvdSubrip>
|
||||
<DvdSubRip>
|
||||
<Title>從 DVD 提取字幕</Title>
|
||||
<DvdGroupTitle>DVD 檔案/訊息</DvdGroupTitle>
|
||||
<IfoFile>IFO 檔案</IfoFile>
|
||||
@ -245,7 +245,7 @@ C# 原始碼可從 https://github.com/SubtitleEdit/subtitleedit 獲得。
|
||||
<ReadingSubtitleData>正在讀取字幕資料...</ReadingSubtitleData>
|
||||
<RippingVobFileXofYZ>正在提取 VOB 檔案 {1}/{2}: {0}</RippingVobFileXofYZ>
|
||||
<WrongIfoType>IFO 類型是 '{0}' 而不是 'DVDVIDEO-VTS'。{1}請嘗試其它檔案而不是 {2}</WrongIfoType>
|
||||
</DvdSubrip>
|
||||
</DvdSubRip>
|
||||
<DvdSubRipChooseLanguage>
|
||||
<Title>選取語系</Title>
|
||||
<ChooseLanguageStreamId>選取語系 (流 ID)</ChooseLanguageStreamId>
|
||||
|
@ -117,7 +117,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
string id = Encoding.UTF8.GetString(buffer);
|
||||
if (id != "DVDVIDEO-VTS")
|
||||
{
|
||||
ErrorMessage = string.Format(Configuration.Settings.Language.DvdSubrip.WrongIfoType, id, Environment.NewLine, fileName);
|
||||
ErrorMessage = string.Format(Configuration.Settings.Language.DvdSubRip.WrongIfoType, id, Environment.NewLine, fileName);
|
||||
return;
|
||||
}
|
||||
ParseVtsVobs();
|
||||
|
@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public LanguageStructure.AddToNames AddToNames;
|
||||
public LanguageStructure.AddToOcrReplaceList AddToOcrReplaceList;
|
||||
public LanguageStructure.AddToUserDictionary AddToUserDictionary;
|
||||
public LanguageStructure.AddWareForm AddWaveForm;
|
||||
public LanguageStructure.AddWaveForm AddWaveForm;
|
||||
public LanguageStructure.AdjustDisplayDuration AdjustDisplayDuration;
|
||||
public LanguageStructure.ApplyDurationLimits ApplyDurationLimits;
|
||||
public LanguageStructure.AutoBreakUnbreakLines AutoBreakUnbreakLines;
|
||||
@ -35,7 +35,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public LanguageStructure.CompareSubtitles CompareSubtitles;
|
||||
public LanguageStructure.DCinemaProperties DCinemaProperties;
|
||||
public LanguageStructure.DurationsBridgeGaps DurationsBridgeGaps;
|
||||
public LanguageStructure.DvdSubRip DvdSubrip;
|
||||
public LanguageStructure.DvdSubRip DvdSubRip;
|
||||
public LanguageStructure.DvdSubRipChooseLanguage DvdSubRipChooseLanguage;
|
||||
public LanguageStructure.EbuSaveOtpions EbuSaveOtpions;
|
||||
public LanguageStructure.EffectKaraoke EffectKaraoke;
|
||||
@ -214,7 +214,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
Description = "Add word to user dictionary (not case sensitive)",
|
||||
};
|
||||
|
||||
AddWaveForm = new LanguageStructure.AddWareForm
|
||||
AddWaveForm = new LanguageStructure.AddWaveForm
|
||||
{
|
||||
Title = "Generate wave form data",
|
||||
GenerateWaveFormData = "Generate wave form data",
|
||||
@ -438,7 +438,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
DivideEven = "Texts divides gap time",
|
||||
};
|
||||
|
||||
DvdSubrip = new LanguageStructure.DvdSubRip
|
||||
DvdSubRip = new LanguageStructure.DvdSubRip
|
||||
{
|
||||
Title = "Rip subtitles from ifo/vobs (dvd)",
|
||||
DvdGroupTitle = "DVD files/info",
|
||||
@ -2336,15 +2336,6 @@ Keep changes?",
|
||||
|
||||
}
|
||||
|
||||
public static Language LoadAndDecompress(StreamReader sr)
|
||||
{
|
||||
using (var zip = new GZipStream(sr.BaseStream, CompressionMode.Decompress))
|
||||
{
|
||||
var s = new XmlSerializer(typeof(Language));
|
||||
return (Language)s.Deserialize(zip);
|
||||
}
|
||||
}
|
||||
|
||||
public static Language Load(StreamReader sr)
|
||||
{
|
||||
var s = new XmlSerializer(typeof(Language));
|
||||
@ -2352,6 +2343,11 @@ Keep changes?",
|
||||
return language;
|
||||
}
|
||||
|
||||
public static Language Load(string fileName)
|
||||
{
|
||||
return LanguageDeserializer.CustomDeserializeLanguage(fileName);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
var s = new XmlSerializer(typeof(Language));
|
||||
|
6107
src/Logic/LanguageDeserializer.cs
Normal file
6107
src/Logic/LanguageDeserializer.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -101,7 +101,7 @@
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class AddWareForm
|
||||
public class AddWaveForm
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string SourceVideoFile { get; set; }
|
||||
|
108
src/Logic/XmlDeserializerGenerator.cs
Normal file
108
src/Logic/XmlDeserializerGenerator.cs
Normal file
@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
public static class XmlDeserializerGenerator
|
||||
{
|
||||
|
||||
public static string GenerateCSharpXmlDeserializerForLanguageStructure()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine(@"using System.IO;
|
||||
using System.Xml;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
|
||||
public class LanguageDeserializer
|
||||
{
|
||||
|
||||
public static Language CustomDeserializeLanguage(string fileName)
|
||||
{
|
||||
var doc = new XmlDocument();
|
||||
doc.PreserveWhitespace = true;
|
||||
|
||||
var stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||
doc.Load(stream);
|
||||
stream.Close();
|
||||
|
||||
XmlNode node = doc.DocumentElement;
|
||||
XmlNode subNode;
|
||||
var language = new Language();
|
||||
");
|
||||
sb.AppendLine(GenerateCSharpXmlDeserializer(typeof(Language), "language", string.Empty));
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("\t\t\treturn language;");
|
||||
sb.AppendLine("\t\t}");
|
||||
sb.AppendLine("\t}");
|
||||
sb.AppendLine("}");
|
||||
System.IO.File.WriteAllText(@"C:\Data\subtitleedit\subtitleedit\src\Logic\LanguageDeserializer.cs", sb.ToString());
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string GenerateCSharpXmlDeserializer(Type classType, string currentName, string xmlPath)
|
||||
{
|
||||
xmlPath = xmlPath.Trim('/');
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var properties = classType.GetProperties();
|
||||
if (properties.Length == 0)
|
||||
{
|
||||
var fields = classType.GetFields();
|
||||
foreach (var fieldInfo in fields)
|
||||
{
|
||||
if (fieldInfo.FieldType.Name == "String")
|
||||
{
|
||||
sb.AppendLine("\t\t\tsubNode = node.SelectSingleNode(\"" + fieldInfo.Name + "\");");
|
||||
sb.AppendLine("\t\t\tif (subNode != null)");
|
||||
sb.AppendLine("\t\t\t\t" + currentName + "." + fieldInfo.Name + " = subNode.InnerText;");
|
||||
}
|
||||
}
|
||||
foreach (var fieldInfo in fields)
|
||||
{
|
||||
if (fieldInfo.FieldType.Name != "String" && fieldInfo.FieldType.FullName.Contains("LanguageStructure"))
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("\t\t\t" + currentName + "." + fieldInfo.Name + " = new " + fieldInfo.FieldType.FullName.Replace("+", ".") + "();");
|
||||
sb.AppendLine("\t\t\tnode = doc.DocumentElement.SelectSingleNode(\"" + fieldInfo.Name + "\");");
|
||||
sb.AppendLine("\t\t\tif (node != null)");
|
||||
sb.AppendLine("\t\t\t{");
|
||||
sb.AppendLine(GenerateCSharpXmlDeserializer(fieldInfo.FieldType, currentName + "." + fieldInfo.Name, xmlPath + "/" + fieldInfo.Name + "/"));
|
||||
sb.AppendLine("\t\t\t}");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var prp in properties)
|
||||
{
|
||||
if (prp.PropertyType.Name == "String")
|
||||
{
|
||||
sb.AppendLine("\t\t\tsubNode = node.SelectSingleNode(\"" + prp.Name + "\");");
|
||||
sb.AppendLine("\t\t\tif (subNode != null)");
|
||||
sb.AppendLine("\t\t\t\t" + currentName + "." + prp.Name + " = subNode.InnerText;");
|
||||
}
|
||||
}
|
||||
foreach (var prp in properties)
|
||||
{
|
||||
if (prp.PropertyType.Name != "String" && prp.PropertyType.FullName.Contains("LanguageStructure"))
|
||||
{
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("\t\t\t" + currentName + "." + prp.Name + " = new " + prp.PropertyType.FullName.Replace("+", ".") + "();");
|
||||
sb.AppendLine("\t\t\tnode = doc.DocumentElement.SelectSingleNode(\"" + xmlPath + "/" + prp.Name + "\");");
|
||||
sb.AppendLine("\t\t\tif (node != null)");
|
||||
sb.AppendLine("\t\t\t{");
|
||||
sb.AppendLine(GenerateCSharpXmlDeserializer(prp.PropertyType, currentName + "." + prp.Name, xmlPath + "/" + prp.Name + "/"));
|
||||
sb.AppendLine("\t\t\t}");
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -117,11 +117,11 @@
|
||||
<Compile Include="Forms\AddToUserDic.Designer.cs">
|
||||
<DependentUpon>AddToUserDic.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\AddWareForm.cs">
|
||||
<Compile Include="Forms\AddWaveForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\AddWareForm.Designer.cs">
|
||||
<DependentUpon>AddWareForm.cs</DependentUpon>
|
||||
<Compile Include="Forms\AddWaveForm.Designer.cs">
|
||||
<DependentUpon>AddWaveForm.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\AlignmentPicker.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -763,6 +763,7 @@
|
||||
<Compile Include="Logic\Forms\RemoveTextForHISettings.cs" />
|
||||
<Compile Include="Logic\Forms\RemoveTextForHI.cs" />
|
||||
<Compile Include="Logic\Forms\SplitLongLinesHelper.cs" />
|
||||
<Compile Include="Logic\LanguageDeserializer.cs" />
|
||||
<Compile Include="Logic\MurMurHash3.cs" />
|
||||
<Compile Include="Logic\NHunspell\Hunspell.cs" />
|
||||
<Compile Include="Logic\NHunspell\Hyphen.cs" />
|
||||
@ -1136,6 +1137,7 @@
|
||||
<Compile Include="Logic\VobSub\VobSubPack.cs" />
|
||||
<Compile Include="Logic\VobSub\VobSubWriter.cs" />
|
||||
<Compile Include="Logic\WordSpellChecker.cs" />
|
||||
<Compile Include="Logic\XmlDeserializerGenerator.cs" />
|
||||
<Compile Include="Logic\XSub.cs" />
|
||||
<Compile Include="Logic\zlib\Adler32.cs" />
|
||||
<Compile Include="Logic\zlib\Deflate.cs" />
|
||||
@ -1201,8 +1203,8 @@
|
||||
<EmbeddedResource Include="Forms\AddToUserDic.resx">
|
||||
<DependentUpon>AddToUserDic.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\AddWareForm.resx">
|
||||
<DependentUpon>AddWareForm.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Forms\AddWaveForm.resx">
|
||||
<DependentUpon>AddWaveForm.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\AlignmentPicker.resx">
|
||||
<DependentUpon>AlignmentPicker.cs</DependentUpon>
|
||||
|
Loading…
Reference in New Issue
Block a user