+ private void SecondsOrFramesChanged(object sender, EventArgs e)\r
+ {\r
+ int start, end;\r
+ int.TryParse(drop_chapterStart.Text, out start);\r
+ int.TryParse(drop_chapterFinish.Text, out end);\r
+ double duration = end - start;\r
+\r
+ switch (drop_mode.SelectedIndex)\r
+ {\r
+ case 1:\r
+ lbl_duration.Text = TimeSpan.FromSeconds(duration).ToString();\r
+ return;\r
+ case 2:\r
+ if (selectedTitle != null)\r
+ {\r
+ duration = duration/selectedTitle.Fps;\r
+ lbl_duration.Text = TimeSpan.FromSeconds(duration).ToString();\r
+ }\r
+ else\r
+ lbl_duration.Text = "--:--:--";\r
+\r
+ return;\r
+ }\r
+ }\r
+\r
+ private void drop_mode_SelectedIndexChanged(object sender, EventArgs e)\r
+ {\r
+ // Reset\r
+ this.drop_chapterFinish.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);\r
+ this.drop_chapterStart.TextChanged -= new EventHandler(this.SecondsOrFramesChanged);\r
+\r
+ // Do Work\r
+ switch (drop_mode.SelectedIndex)\r
+ {\r
+ case 0:\r
+ drop_chapterStart.DropDownStyle = ComboBoxStyle.DropDownList;\r
+ drop_chapterFinish.DropDownStyle = ComboBoxStyle.DropDownList;\r
+ if (drop_chapterStart.Items.Count != 0)\r
+ {\r
+ drop_chapterStart.SelectedIndex = 0;\r
+ drop_chapterFinish.SelectedIndex = drop_chapterFinish.Items.Count - 1;\r
+ }\r
+ else\r
+ lbl_duration.Text = "--:--:--";\r
+ return;\r
+ case 1:\r
+ this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);\r
+ this.drop_chapterFinish.TextChanged += new EventHandler(this.SecondsOrFramesChanged);\r
+ drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;\r
+ drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;\r
+ if (selectedTitle != null)\r
+ {\r
+ drop_chapterStart.Text = "0";\r
+ drop_chapterFinish.Text = selectedTitle.Duration.TotalSeconds.ToString();\r
+ }\r
+ return;\r
+ case 2:\r
+ this.drop_chapterStart.TextChanged += new EventHandler(this.SecondsOrFramesChanged);\r
+ this.drop_chapterFinish.TextChanged += new EventHandler(this.SecondsOrFramesChanged);\r
+ drop_chapterStart.DropDownStyle = ComboBoxStyle.Simple;\r
+ drop_chapterFinish.DropDownStyle = ComboBoxStyle.Simple;\r
+ if (selectedTitle != null)\r
+ {\r
+ drop_chapterStart.Text = "0";\r
+ drop_chapterFinish.Text = (selectedTitle.Fps*selectedTitle.Duration.TotalSeconds).ToString();\r
+ }\r
+ return;\r
+ }\r
+ }\r
+\r
+ // Destination\r