-
Notifications
You must be signed in to change notification settings - Fork 449
Expand file tree
/
Copy pathGifWriterForm.cs
More file actions
46 lines (39 loc) · 1.14 KB
/
GifWriterForm.cs
File metadata and controls
46 lines (39 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Windows.Forms;
using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
public partial class GifWriterForm : FormBase
{
protected override string WindowTitleStatic => "GIF Writer Options";
public GifWriterForm()
{
InitializeComponent();
}
public static GifWriter.GifToken DoTokenForm(IWin32Window parent, Config config)
{
using var dlg = new GifWriterForm
{
numericUpDown1 = { Value = config.GifWriterFrameskip },
numericUpDown2 = { Value = config.GifWriterDelay },
};
dlg.NumericUpDown2_ValueChanged(null, EventArgs.Empty);
var result = dlg.ShowDialog(parent);
if (result.IsOk())
{
config.GifWriterFrameskip = (int)dlg.numericUpDown1.Value;
config.GifWriterDelay = (int)dlg.numericUpDown2.Value;
return GifWriter.GifToken.LoadFromConfig(config);
}
return null;
}
private void NumericUpDown2_ValueChanged(object sender, EventArgs e)
{
label3.Text = numericUpDown2.Value switch
{
-1 => "Auto",
0 => "Fastest",
_ => $"{(int) ((100 + numericUpDown2.Value / 2) / numericUpDown2.Value)} FPS",
};
}
}
}