summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions
diff options
context:
space:
mode:
authorsr55 <[email protected]>2009-08-02 14:48:07 +0000
committersr55 <[email protected]>2009-08-02 14:48:07 +0000
commit6f76fa075fe26dbb103c945cdbd55719379f88a4 (patch)
tree513b1778be69ec236b695fe0b9bd7fcc9f27be78 /win/C#/Functions
parent156bb687bd00bec7c8ac5b27363c5efb27e2626c (diff)
WinGui:
- Fix subtitle offset control. Was limited to 100. Changed increment to 10ms jumps. - Added Import CSV function for the chapter markers tab. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2746 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Functions')
-rw-r--r--win/C#/Functions/Main.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/win/C#/Functions/Main.cs b/win/C#/Functions/Main.cs
index 987876e56..9a8b9a02f 100644
--- a/win/C#/Functions/Main.cs
+++ b/win/C#/Functions/Main.cs
@@ -80,6 +80,40 @@ namespace Handbrake.Functions
return dataChpt;
}
+ public static DataGridView importChapterNames(DataGridView dataChpt, string filename)
+ {
+ IDictionary<int, string> chapterMap = new Dictionary<int, string>();
+ try
+ {
+ StreamReader sr = new StreamReader(filename);
+ string csv = sr.ReadLine();
+ while (csv != null)
+ {
+ if (csv.Trim() != "")
+ {
+ string[] contents = csv.Split(',');
+ int chapter;
+ int.TryParse(contents[0], out chapter);
+ chapterMap.Add(chapter, contents[1]);
+ }
+ csv = sr.ReadLine();
+ }
+ }
+ catch (Exception)
+ {
+ return null;
+ }
+
+ foreach (DataGridViewRow item in dataChpt.Rows)
+ {
+ string name;
+ chapterMap.TryGetValue((int)item.Cells[0].Value, out name);
+ item.Cells[1].Value = name ?? "Chapter " + item.Cells[0].Value;
+ }
+
+ return dataChpt;
+ }
+
/// <summary>
/// Function which generates the filename and path automatically based on
/// the Source Name, DVD title and DVD Chapters