diff options
Diffstat (limited to 'win/C#/frmMain.cs')
-rw-r--r-- | win/C#/frmMain.cs | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index e7345b539..d66692da6 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -713,15 +713,16 @@ namespace Handbrake private void drop_format_SelectedIndexChanged(object sender, EventArgs e)
{
if (drop_format.SelectedIndex == 0)
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".mp4");
+ setExtension(".mp4");
else if (drop_format.SelectedIndex == 1)
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".m4v");
+ setExtension(".m4v");
else if (drop_format.SelectedIndex == 2)
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".mkv");
+ setExtension(".mkv");
else if (drop_format.SelectedIndex == 3)
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".avi");
+ setExtension(".avi");
else if (drop_format.SelectedIndex == 4)
- text_destination.Text = hb_common_func.setExtension(text_destination.Text, ".ogm");
+ setExtension(".ogm");
+
}
//Video Tab
@@ -1578,6 +1579,20 @@ namespace Handbrake }
}
}
+ /// <summary>
+ /// Take in a File destination and change it's file extension to a new Extension
+ /// </summary>
+ /// <param name="destination"></param>
+ /// <param name="newExtension"></param>
+ /// <returns>String of the new file path and extension</returns>
+ public void setExtension(string newExtension)
+ {
+ text_destination.Text = text_destination.Text.Replace(".mp4", newExtension);
+ text_destination.Text = text_destination.Text.Replace(".m4v", newExtension);
+ text_destination.Text = text_destination.Text.Replace(".mkv", newExtension);
+ text_destination.Text = text_destination.Text.Replace(".avi", newExtension);
+ text_destination.Text = text_destination.Text.Replace(".ogm", newExtension);
+ }
#endregion
#region Drive Detection
|