Skip to content

Commit 586bf81

Browse files
fix for #14
1 parent 28ee963 commit 586bf81

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Form1.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ public partial class Form1 : Form
2222
private string TOMLPath;
2323
private FlexGUIConfig flexGUIConfig;
2424
private System.Text.Encoding enc1252;
25+
private string flexasioGuiVersion = "0.3";
26+
private string flexasioVersion = "1.7a";
27+
private string tomlName = "FlexASIO.toml";
2528

2629
public Form1()
2730
{
2831
InitializeComponent();
2932

30-
this.Text = "FlexASIO GUI v0.2";
33+
this.Text = $"FlexASIO GUI v{flexasioGuiVersion}";
3134

3235
System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
3336
customCulture.NumberFormat.NumberDecimalSeparator = ".";
@@ -38,7 +41,7 @@ public Form1()
3841
CultureInfo.DefaultThreadCurrentCulture = customCulture;
3942
CultureInfo.DefaultThreadCurrentUICulture = customCulture;
4043

41-
TOMLPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\FlexASIO.toml";
44+
TOMLPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}\\{tomlName}";
4245

4346
flexGUIConfig = new FlexGUIConfig();
4447
if (File.Exists(TOMLPath))
@@ -86,7 +89,7 @@ public Form1()
8689
wasapiAutoConvertOutput.Checked = flexGUIConfig.output.wasapiAutoConvert;
8790

8891
InitDone = true;
89-
SetStatusMessage($"FlexASIO GUI for FlexASIO 0.15 started ({Configuration.VersionString})");
92+
SetStatusMessage($"FlexASIO GUI for FlexASIO {flexasioVersion} started ({Configuration.VersionString})");
9093
GenerateOutput();
9194
}
9295

@@ -147,6 +150,7 @@ private void comboBackend_SelectedIndexChanged(object sender, EventArgs e)
147150
treeDevicesOutput.Nodes.Clear();
148151
treeDevicesOutput.Nodes.AddRange(GetDevicesForBackend(selectedBackend, false));
149152
}
153+
if (selectedBackend == "(None)") selectedBackend = "";
150154
flexGUIConfig.backend = selectedBackend;
151155
GenerateOutput();
152156
}
@@ -183,7 +187,7 @@ private void btSaveAs_Click(object sender, EventArgs e)
183187
{
184188
SaveFileDialog saveFileDialog = new SaveFileDialog();
185189
saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
186-
saveFileDialog.FileName = "FlexASIO.toml";
190+
saveFileDialog.FileName = tomlName;
187191
var ret = saveFileDialog.ShowDialog();
188192
if (ret == DialogResult.OK)
189193
{
@@ -233,7 +237,7 @@ private void treeDevicesInput_AfterSelect(object sender, TreeViewEventArgs e)
233237
if (o.SelectedNode != null)
234238
{
235239
o.SelectedNode.Checked = true;
236-
flexGUIConfig.input.device = o.SelectedNode.Text;
240+
flexGUIConfig.input.device = o.SelectedNode.Text == "(None)" ? "" : o.SelectedNode.Text;
237241
GenerateOutput();
238242
}
239243
}
@@ -245,7 +249,7 @@ private void treeDevicesOutput_AfterSelect(object sender, TreeViewEventArgs e)
245249
if (o.SelectedNode != null)
246250
{
247251
o.SelectedNode.Checked = true;
248-
flexGUIConfig.output.device = o.SelectedNode.Text;
252+
flexGUIConfig.output.device = o.SelectedNode.Text == "(None)" ? "" : o.SelectedNode.Text;
249253
GenerateOutput();
250254
}
251255
}

0 commit comments

Comments
 (0)