mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-26 23:12:38 +02:00
Multi-language additions (Forms/AddWaveForm)
This commit is contained in:
parent
ee2d4020fd
commit
6c926b4178
@ -111,6 +111,17 @@ Email: mailto:nikse.dk@gmail.com</AboutText1>
|
||||
<GeneratingSpectrogram>Generating spectrogram...</GeneratingSpectrogram>
|
||||
<ExtractingSeconds>Extracting audio: {0:0.0} seconds</ExtractingSeconds>
|
||||
<ExtractingMinutes>Extracting audio: {0}.{1:00} minutes</ExtractingMinutes>
|
||||
<WaveFileNotFound>Could not find extracted wave file!
|
||||
This feature requires VLC media player 1.1.x or newer ({0}-bit).
|
||||
|
||||
Command line: {1} {2}</WaveFileNotFound>
|
||||
<WaveFileMalformed>{0} was unable to extract audio data to wave file!
|
||||
|
||||
Command line: {1} {2}
|
||||
|
||||
Note: Do check free disk space.</WaveFileMalformed>
|
||||
<LowDiskSpace>LOW DISK SPACE!</LowDiskSpace>
|
||||
<FreeDiskSpace>{0} free</FreeDiskSpace>
|
||||
</AddWaveform>
|
||||
<AddWaveformBatch>
|
||||
<Title>Batch generate waveform data</Title>
|
||||
|
@ -76,7 +76,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
if (Configuration.Settings.General.UseFFmpegForWaveExtraction && File.Exists(Configuration.Settings.General.FFmpegLocation))
|
||||
{
|
||||
encoderName = "FFMPEG";
|
||||
encoderName = "FFmpeg";
|
||||
const 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
|
||||
@ -100,19 +100,19 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string targetFile = Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".wav");
|
||||
|
||||
labelPleaseWait.Visible = true;
|
||||
string encoderName;
|
||||
Process process;
|
||||
try
|
||||
{
|
||||
string encoderName;
|
||||
process = GetCommandLineProcess(SourceVideoFileName, _audioTrackNumber, targetFile, _encodeParamters, out encoderName);
|
||||
labelInfo.Text = encoderName;
|
||||
}
|
||||
catch (DllNotFoundException)
|
||||
{
|
||||
if (MessageBox.Show(Configuration.Settings.Language.AddWaveform.VlcMediaPlayerNotFound + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
Configuration.Settings.Language.AddWaveform.GoToVlcMediaPlayerHomePage,
|
||||
Configuration.Settings.Language.AddWaveform.VlcMediaPlayerNotFoundTitle, MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
Environment.NewLine + Configuration.Settings.Language.AddWaveform.GoToVlcMediaPlayerHomePage,
|
||||
Configuration.Settings.Language.AddWaveform.VlcMediaPlayerNotFoundTitle,
|
||||
MessageBoxButtons.YesNo) == DialogResult.Yes)
|
||||
{
|
||||
Process.Start("http://www.videolan.org/");
|
||||
}
|
||||
@ -163,11 +163,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (drive.AvailableFreeSpace < 50 * 1000000) // 50 mb
|
||||
{
|
||||
labelInfo.ForeColor = Color.Red;
|
||||
labelInfo.Text = "LOW DISC SPACE!";
|
||||
labelInfo.Text = Configuration.Settings.Language.AddWaveform.LowDiskSpace;
|
||||
}
|
||||
else if (labelInfo.ForeColor == Color.Red)
|
||||
{
|
||||
labelInfo.Text = Utilities.FormatBytesToDisplayFileSize(drive.AvailableFreeSpace) + " free";
|
||||
labelInfo.Text = string.Format(Configuration.Settings.Language.AddWaveform.FreeDiskSpace, Utilities.FormatBytesToDisplayFileSize(drive.AvailableFreeSpace));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -182,7 +182,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
progressBar1.Style = ProgressBarStyle.Blocks;
|
||||
process.Dispose();
|
||||
|
||||
if (!File.Exists(targetFile))
|
||||
var targetFileInfo = new FileInfo(targetFile);
|
||||
if (!targetFileInfo.Exists)
|
||||
{
|
||||
if (_encodeParamters != RetryEncodeParameters)
|
||||
{
|
||||
@ -191,9 +192,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
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: " + process.StartInfo.FileName + " " + process.StartInfo.Arguments);
|
||||
MessageBox.Show(string.Format(Configuration.Settings.Language.AddWaveform.WaveFileNotFound, IntPtr.Size * 8, process.StartInfo.FileName, process.StartInfo.Arguments));
|
||||
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
@ -201,14 +200,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return;
|
||||
}
|
||||
|
||||
var fi = new FileInfo(targetFile);
|
||||
if (fi.Length <= 200)
|
||||
if (targetFileInfo.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: " + process.StartInfo.FileName + " " + process.StartInfo.Arguments + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Note: Do check free disk space.");
|
||||
MessageBox.Show(string.Format(Configuration.Settings.Language.AddWaveform.WaveFileMalformed, encoderName, process.StartInfo.FileName, process.StartInfo.Arguments));
|
||||
|
||||
labelPleaseWait.Visible = false;
|
||||
labelProgress.Text = string.Empty;
|
||||
buttonRipWave.Enabled = true;
|
||||
|
@ -230,6 +230,17 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
GeneratingSpectrogram = "Generating spectrogram...",
|
||||
ExtractingSeconds = "Extracting audio: {0:0.0} seconds",
|
||||
ExtractingMinutes = "Extracting audio: {0}.{1:00} minutes",
|
||||
WaveFileNotFound = "Could not find extracted wave file!" + Environment.NewLine +
|
||||
"This feature requires VLC media player 1.1.x or newer ({0}-bit)." + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Command line: {1} {2}",
|
||||
WaveFileMalformed = "{0} was unable to extract audio data to wave file!" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Command line: {1} {2}" + Environment.NewLine +
|
||||
Environment.NewLine +
|
||||
"Note: Do check free disk space.",
|
||||
LowDiskSpace = "LOW DISK SPACE!",
|
||||
FreeDiskSpace = "{0} free",
|
||||
};
|
||||
|
||||
AddWaveformBatch = new LanguageStructure.AddWaveformBatch
|
||||
@ -607,7 +618,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
SavePremiereEdlAs = "Choose Premiere EDL file name",
|
||||
SaveFcpAs = "Choose Final Cut Pro xml file name",
|
||||
SaveDostAs = "Choose DoStudio dost file name",
|
||||
SomeLinesWereTooLongX = "Some lines were too long:\r\n{0}",
|
||||
SomeLinesWereTooLongX = "Some lines were too long:" + Environment.NewLine + "{0}",
|
||||
LineHeight = "Line height",
|
||||
BoxSingleLine = "Box - single line",
|
||||
BoxMultiLine = "Box - multi line",
|
||||
@ -934,7 +945,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
SavedOriginalSubtitleX = "Saved original subtitle {0}",
|
||||
FileOnDiskModified = "File on disk modified",
|
||||
OverwriteModifiedFile = "Overwrite the file {0} modified at {1} {2}{3} with current file loaded from disk at {4} {5}?",
|
||||
FileXIsReadOnly = "Cannot save {0}\r\n\r\nFile is read-only!",
|
||||
FileXIsReadOnly = "Cannot save {0}" + Environment.NewLine + Environment.NewLine + "File is read-only!",
|
||||
UnableToSaveSubtitleX = "Unable to save subtitle file {0}" + Environment.NewLine + "Subtitle seems to be empty - try to re-save if you're working on a valid subtitle!",
|
||||
BeforeNew = "Before new",
|
||||
New = "New",
|
||||
|
@ -324,6 +324,18 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
case "AddWaveform/ExtractingMinutes":
|
||||
language.AddWaveform.ExtractingMinutes = reader.Value;
|
||||
break;
|
||||
case "AddWaveform/WaveFileNotFound":
|
||||
language.AddWaveform.WaveFileNotFound = reader.Value;
|
||||
break;
|
||||
case "AddWaveform/WaveFileMalformed":
|
||||
language.AddWaveform.WaveFileMalformed = reader.Value;
|
||||
break;
|
||||
case "AddWaveform/LowDiskSpace":
|
||||
language.AddWaveform.LowDiskSpace = reader.Value;
|
||||
break;
|
||||
case "AddWaveform/FreeDiskSpace":
|
||||
language.AddWaveform.FreeDiskSpace = reader.Value;
|
||||
break;
|
||||
case "AddWaveformBatch/Title":
|
||||
language.AddWaveformBatch.Title = reader.Value;
|
||||
break;
|
||||
|
@ -116,6 +116,10 @@
|
||||
public string GeneratingSpectrogram { get; set; }
|
||||
public string ExtractingSeconds { get; set; }
|
||||
public string ExtractingMinutes { get; set; }
|
||||
public string WaveFileNotFound { get; set; }
|
||||
public string WaveFileMalformed { get; set; }
|
||||
public string LowDiskSpace { get; set; }
|
||||
public string FreeDiskSpace { get; set; }
|
||||
}
|
||||
|
||||
public class AddWaveformBatch
|
||||
|
Loading…
Reference in New Issue
Block a user