Seek silence in waveform now remembers 'max volume' - thx vmb :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1855 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-06-01 17:37:42 +00:00
parent c51413b79d
commit 5bf9303da6
2 changed files with 12 additions and 6 deletions

View File

@ -51,7 +51,7 @@ namespace Nikse.SubtitleEdit.Forms
SecondsDuration = (double)numericUpDownSeconds.Value;
VolumeBelow = (int)numericUpDownVolume.Value;
Configuration.Settings.VideoControls.WaveformSeeksSilenceDurationSeconds = SecondsDuration;
numericUpDownVolume.Value = VolumeBelow;
Configuration.Settings.VideoControls.WaveformSeeksSilenceMaxVolume = VolumeBelow;
DialogResult = DialogResult.OK;
}

View File

@ -36,14 +36,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>" + Environment.NewLine +
"<USFSubtitles version=\"1.0\">" + Environment.NewLine +
@"<metadata>
<title>The Universal Subtitle Format sample</title>
<title>Universal Subtitle Format</title>
<author>
<name>SubtitleEdit</name>
<email>nikse.dk@gmail.com</email>
<url>http://www.nikse.dk/</url>
</author>" +
"<language code=\"eng\">English</language>" + Environment.NewLine +
@"<date>2002-11-08</date>
</author>" + Environment.NewLine +
" <language code=\"eng\">English</language>" + Environment.NewLine +
@" <date>[DATE]</date>
<comment>This is a USF file</comment>
</metadata>
<styles>
@ -58,9 +58,11 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
<subtitles>
</subtitles>
</USFSubtitles>";
xmlStructure = xmlStructure.Replace("[DATE]", DateTime.Now.ToString("yyyy-MM-dd"));
var xml = new XmlDocument();
xml.LoadXml(xmlStructure);
xml.DocumentElement.SelectSingleNode("metadata/title").InnerText = title;
var subtitlesNode = xml.DocumentElement.SelectSingleNode("subtitles");
foreach (Paragraph p in subtitle.Paragraphs)
@ -69,7 +71,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
XmlAttribute start = xml.CreateAttribute("start");
start.InnerText = p.StartTime.ToString().Replace(",", ".");
paragraph.Attributes.Append(start);
paragraph.Attributes.Prepend(start);
XmlAttribute stop = xml.CreateAttribute("stop");
stop.InnerText = p.EndTime.ToString().Replace(",", ".");
@ -79,6 +81,10 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
text.InnerText = Utilities.RemoveHtmlTags(p.Text);
paragraph.AppendChild(text);
XmlAttribute style = xml.CreateAttribute("style");
style.InnerText = "Default";
text.Attributes.Append(style);
subtitlesNode.AppendChild(paragraph);
}