Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/LiveSplit.Video/VideoSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows.Forms;
using System.Xml;

using LiveSplit.Localization;
using LiveSplit.Model;
using LiveSplit.Options;
using LiveSplit.TimeFormatters;
Expand All @@ -14,6 +15,8 @@ namespace LiveSplit.Video;

public partial class VideoSettings : UserControl
{
private static string T(string source) => UiLocalizer.Translate(source, LanguageResolver.ResolveCurrentCultureLanguage());

public string MRL => HttpUtility.UrlPathEncode("file:///" + VideoPath.Replace('\\', '/').Replace("%", "%25"));
public string VideoPath { get; set; }
public TimeSpan Offset { get; set; }
Expand Down Expand Up @@ -93,7 +96,7 @@ private void btnSelectFile_Click(object sender, EventArgs e)
{
var dialog = new OpenFileDialog()
{
Filter = "Video Files|*.avi;*.mpeg;*.mpg;*.mp4;*.mov;*.wmv;*.m4v;*.flv;*.mkv;*.ogg|All Files (*.*)|*.*"
Filter = T("Video Files|*.avi;*.mpeg;*.mpg;*.mp4;*.mov;*.wmv;*.m4v;*.flv;*.mkv;*.ogg|All Files (*.*)|*.*")
};
if (File.Exists(VideoPath))
{
Expand All @@ -116,15 +119,15 @@ private void VideoSettings_Load(object sender, EventArgs e)
trkHeightWidth.Minimum = 100;
trkHeightWidth.Maximum = 400;
trkHeightWidth.DataBindings.Add("Value", this, "Width", false, DataSourceUpdateMode.OnPropertyChanged);
lblHeightWidth.Text = "Width:";
lblHeightWidth.Text = T("Width:");
}
else
{
trkHeightWidth.DataBindings.Clear();
trkHeightWidth.Minimum = 100;
trkHeightWidth.Maximum = 300;
trkHeightWidth.DataBindings.Add("Value", this, "Height", false, DataSourceUpdateMode.OnPropertyChanged);
lblHeightWidth.Text = "Height:";
lblHeightWidth.Text = T("Height:");
}
}
}