Remember more settings in Export window

This commit is contained in:
niksedk 2014-04-13 14:50:40 +02:00
parent efba90f7ab
commit 88edb28caf
2 changed files with 45 additions and 4 deletions

View File

@ -2285,6 +2285,12 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
comboBoxBorderWidth.SelectedIndex = 2; comboBoxBorderWidth.SelectedIndex = 2;
comboBoxHAlign.SelectedIndex = 1; comboBoxHAlign.SelectedIndex = 1;
comboBoxResolution.SelectedIndex = 0; comboBoxResolution.SelectedIndex = 0;
if (Configuration.Settings.Tools.ExportLastShadowTransparency <= numericUpDownShadowTransparency.Maximum && Configuration.Settings.Tools.ExportLastShadowTransparency > 0)
{
numericUpDownShadowTransparency.Value = Configuration.Settings.Tools.ExportLastShadowTransparency;
}
if ((_exportType == "BLURAYSUP" || _exportType == "DOST") && !string.IsNullOrEmpty(Configuration.Settings.Tools.ExportBluRayVideoResolution)) if ((_exportType == "BLURAYSUP" || _exportType == "DOST") && !string.IsNullOrEmpty(Configuration.Settings.Tools.ExportBluRayVideoResolution))
SetResolution(Configuration.Settings.Tools.ExportBluRayVideoResolution); SetResolution(Configuration.Settings.Tools.ExportBluRayVideoResolution);
@ -2371,11 +2377,9 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
} }
if (comboBoxFramerate.Items.Count >= 2) if (comboBoxFramerate.Items.Count >= 2)
{ {
if (Configuration.Settings.General.CurrentFrameRate == 24) SetLastFrameRate(Configuration.Settings.Tools.ExportLastFrameRate);
comboBoxFramerate.SelectedIndex = 1;
else if (Configuration.Settings.General.CurrentFrameRate == 25)
comboBoxFramerate.SelectedIndex = 2;
} }
panelShadowColor.BackColor = Configuration.Settings.Tools.ExportShadowColor;
for (int i=0; i<1000; i++) for (int i=0; i<1000; i++)
comboBoxBottomMargin.Items.Add(i); comboBoxBottomMargin.Items.Add(i);
@ -2455,6 +2459,22 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
subtitleListView1.SelectIndexAndEnsureVisible(0); subtitleListView1.SelectIndexAndEnsureVisible(0);
} }
private void SetLastFrameRate(double lastFrameRate)
{
for (int i = 0; i < comboBoxFramerate.Items.Count; i++)
{
double d;
if (double.TryParse(comboBoxFramerate.Items[i].ToString().Replace(",", "."), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out d))
{
if (Math.Abs(lastFrameRate - d) < 0.01)
{
comboBoxFramerate.SelectedIndex = i;
return;
}
}
}
}
internal void InitializeFromVobSubOcr(Subtitle subtitle, SubtitleFormat format, string exportType, string fileName, VobSubOcr vobSubOcr, string languageString) internal void InitializeFromVobSubOcr(Subtitle subtitle, SubtitleFormat format, string exportType, string fileName, VobSubOcr vobSubOcr, string languageString)
{ {
_vobSubOcr = vobSubOcr; _vobSubOcr = vobSubOcr;
@ -2719,6 +2739,9 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
Configuration.Settings.Tools.ExportFcpImageType = comboBoxImageFormat.SelectedItem.ToString(); Configuration.Settings.Tools.ExportFcpImageType = comboBoxImageFormat.SelectedItem.ToString();
} }
Configuration.Settings.Tools.ExportLastShadowTransparency = (int)numericUpDownShadowTransparency.Value;
Configuration.Settings.Tools.ExportLastFrameRate = FrameRate;
Configuration.Settings.Tools.ExportShadowColor = panelShadowColor.BackColor;
Configuration.Settings.Tools.ExportFontColor = _subtitleColor; Configuration.Settings.Tools.ExportFontColor = _subtitleColor;
Configuration.Settings.Tools.ExportBorderColor = _borderColor; Configuration.Settings.Tools.ExportBorderColor = _borderColor;
if (_exportType == "BLURAYSUP" || _exportType == "DOST") if (_exportType == "BLURAYSUP" || _exportType == "DOST")

View File

@ -134,12 +134,15 @@ namespace Nikse.SubtitleEdit.Logic
public string ExportBluRayVideoResolution { get; set; } public string ExportBluRayVideoResolution { get; set; }
public Color ExportFontColor { get; set; } public Color ExportFontColor { get; set; }
public Color ExportBorderColor { get; set; } public Color ExportBorderColor { get; set; }
public Color ExportShadowColor { get; set; }
public int ExportBottomMargin { get; set; } public int ExportBottomMargin { get; set; }
public int ExportHorizontalAlignment { get; set; } public int ExportHorizontalAlignment { get; set; }
public int ExportBluRayBottomMargin { get; set; } public int ExportBluRayBottomMargin { get; set; }
public int ExportBluRayShadow { get; set; } public int ExportBluRayShadow { get; set; }
public int Export3DType { get; set; } public int Export3DType { get; set; }
public int Export3DDepth { get; set; } public int Export3DDepth { get; set; }
public int ExportLastShadowTransparency { get; set; }
public double ExportLastFrameRate { get; set; }
public bool FixCommonErrorsFixOverlapAllowEqualEndStart { get; set; } public bool FixCommonErrorsFixOverlapAllowEqualEndStart { get; set; }
public string ImportTextSplitting { get; set; } public string ImportTextSplitting { get; set; }
public bool ImportTextMergeShortLines { get; set; } public bool ImportTextMergeShortLines { get; set; }
@ -189,6 +192,7 @@ namespace Nikse.SubtitleEdit.Logic
MusicSymbolStyle = "Double"; // 'Double' or 'Single' MusicSymbolStyle = "Double"; // 'Double' or 'Single'
ExportFontColor = Color.White; ExportFontColor = Color.White;
ExportBorderColor = Color.Black; ExportBorderColor = Color.Black;
ExportShadowColor = Color.Black;
ExportBottomMargin = 15; ExportBottomMargin = 15;
ExportHorizontalAlignment = 1; // 1=center (0=left, 2=right) ExportHorizontalAlignment = 1; // 1=center (0=left, 2=right)
ExportVobSubSimpleRendering = true; ExportVobSubSimpleRendering = true;
@ -197,6 +201,8 @@ namespace Nikse.SubtitleEdit.Logic
ExportBluRayShadow = 1; ExportBluRayShadow = 1;
Export3DType = 0; Export3DType = 0;
Export3DDepth = 0; Export3DDepth = 0;
ExportLastShadowTransparency = 200;
ExportLastFrameRate = 24.0d;
ExportFcpImageType = "Bmp"; ExportFcpImageType = "Bmp";
ExportLastBorderWidth = 2; ExportLastBorderWidth = 2;
BridgeGapMilliseconds = 100; BridgeGapMilliseconds = 100;
@ -1614,6 +1620,9 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("ExportBorderColor"); subNode = node.SelectSingleNode("ExportBorderColor");
if (subNode != null) if (subNode != null)
settings.Tools.ExportBorderColor = Color.FromArgb(int.Parse(subNode.InnerText)); settings.Tools.ExportBorderColor = Color.FromArgb(int.Parse(subNode.InnerText));
subNode = node.SelectSingleNode("ExportShadowColor");
if (subNode != null)
settings.Tools.ExportShadowColor = Color.FromArgb(int.Parse(subNode.InnerText));
subNode = node.SelectSingleNode("ExportBottomMargin"); subNode = node.SelectSingleNode("ExportBottomMargin");
if (subNode != null) if (subNode != null)
settings.Tools.ExportBottomMargin = int.Parse(subNode.InnerText); settings.Tools.ExportBottomMargin = int.Parse(subNode.InnerText);
@ -1632,6 +1641,12 @@ namespace Nikse.SubtitleEdit.Logic
subNode = node.SelectSingleNode("Export3DDepth"); subNode = node.SelectSingleNode("Export3DDepth");
if (subNode != null) if (subNode != null)
settings.Tools.Export3DDepth = int.Parse(subNode.InnerText); settings.Tools.Export3DDepth = int.Parse(subNode.InnerText);
subNode = node.SelectSingleNode("ExportLastShadowTransparency");
if (subNode != null)
settings.Tools.ExportLastShadowTransparency = int.Parse(subNode.InnerText, CultureInfo.InvariantCulture);
subNode = node.SelectSingleNode("ExportLastFrameRate");
if (subNode != null)
settings.Tools.ExportLastFrameRate = double.Parse(subNode.InnerText, CultureInfo.InvariantCulture);
subNode = node.SelectSingleNode("FixCommonErrorsFixOverlapAllowEqualEndStart"); subNode = node.SelectSingleNode("FixCommonErrorsFixOverlapAllowEqualEndStart");
if (subNode != null) if (subNode != null)
settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart = Convert.ToBoolean(subNode.InnerText); settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart = Convert.ToBoolean(subNode.InnerText);
@ -2677,12 +2692,15 @@ namespace Nikse.SubtitleEdit.Logic
textWriter.WriteElementString("ExportBluRayVideoResolution", settings.Tools.ExportBluRayVideoResolution); textWriter.WriteElementString("ExportBluRayVideoResolution", settings.Tools.ExportBluRayVideoResolution);
textWriter.WriteElementString("ExportFontColor", settings.Tools.ExportFontColor.ToArgb().ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportFontColor", settings.Tools.ExportFontColor.ToArgb().ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportBorderColor", settings.Tools.ExportBorderColor.ToArgb().ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportBorderColor", settings.Tools.ExportBorderColor.ToArgb().ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportShadowColor", settings.Tools.ExportShadowColor.ToArgb().ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportBottomMargin", settings.Tools.ExportBottomMargin.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportBottomMargin", settings.Tools.ExportBottomMargin.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportHorizontalAlignment", settings.Tools.ExportHorizontalAlignment.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportHorizontalAlignment", settings.Tools.ExportHorizontalAlignment.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportBluRayBottomMargin", settings.Tools.ExportBluRayBottomMargin.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportBluRayBottomMargin", settings.Tools.ExportBluRayBottomMargin.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportBluRayShadow", settings.Tools.ExportBluRayShadow.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("ExportBluRayShadow", settings.Tools.ExportBluRayShadow.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("Export3DType", settings.Tools.Export3DType.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("Export3DType", settings.Tools.Export3DType.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("Export3DDepth", settings.Tools.Export3DDepth.ToString(CultureInfo.InvariantCulture)); textWriter.WriteElementString("Export3DDepth", settings.Tools.Export3DDepth.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportLastShadowTransparency", settings.Tools.ExportLastShadowTransparency.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("ExportLastFrameRate", settings.Tools.ExportLastFrameRate.ToString(CultureInfo.InvariantCulture));
textWriter.WriteElementString("FixCommonErrorsFixOverlapAllowEqualEndStart", settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart.ToString()); textWriter.WriteElementString("FixCommonErrorsFixOverlapAllowEqualEndStart", settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart.ToString());
textWriter.WriteElementString("ImportTextSplitting", settings.Tools.ImportTextSplitting); textWriter.WriteElementString("ImportTextSplitting", settings.Tools.ImportTextSplitting);
textWriter.WriteElementString("ImportTextMergeShortLines", settings.Tools.ImportTextMergeShortLines.ToString()); textWriter.WriteElementString("ImportTextMergeShortLines", settings.Tools.ImportTextMergeShortLines.ToString());