-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSettingsEditor.cs
46 lines (36 loc) · 1.17 KB
/
SettingsEditor.cs
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;
using System.Windows.Forms;
namespace UnderwaterVideo
{
public partial class SettingsEditor : Form
{
#region Properties
public SettingsContainer Value
{
get
{
SettingsContainer result = new SettingsContainer();
result.SampleRateHz = Convert.ToInt32(sampleRateCbx.SelectedItem.ToString());
result.FFTSize = Convert.ToInt32(FFTSizeCbx.SelectedItem.ToString());
return result;
}
set
{
int idx = -1;
idx = sampleRateCbx.Items.IndexOf(value.SampleRateHz.ToString());
if (idx >= 0) sampleRateCbx.SelectedIndex = idx;
idx = FFTSizeCbx.Items.IndexOf(value.FFTSize.ToString());
if (idx >= 0) FFTSizeCbx.SelectedIndex = idx;
}
}
#endregion
#region Constructor
public SettingsEditor()
{
InitializeComponent();
sampleRateCbx.SelectedIndex = 0;
FFTSizeCbx.SelectedIndex = 0;
}
#endregion
}
}