Skip to content

Commit 28ee963

Browse files
v0.2 - fixes unicode naming issue
1 parent ba56da0 commit 28ee963

File tree

6 files changed

+27
-48
lines changed

6 files changed

+27
-48
lines changed

FlexASIOGUI.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7+
<Platforms>AnyCPU;x64</Platforms>
78
</PropertyGroup>
89

910
<ItemGroup>
1011
<PackageReference Include="Nett" Version="0.15.0" />
12+
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.7.1" />
1113
</ItemGroup>
1214

1315
<ItemGroup>
1416
<Reference Include="portaudio-sharp">
15-
<HintPath>lib\portaudio-sharp.dll</HintPath>
17+
<HintPath>lib\Debug\portaudio-sharp.dll</HintPath>
1618
</Reference>
1719
</ItemGroup>
1820

FlexASIOGUI.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.30114.105
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlexASIOGUI", "FlexASIOGUI.csproj", "{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlexASIOGUI", "FlexASIOGUI.csproj", "{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
11+
Debug|x64 = Debug|x64
1112
Release|Any CPU = Release|Any CPU
13+
Release|x64 = Release|x64
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1416
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1517
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Debug|x64.ActiveCfg = Debug|x64
19+
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Debug|x64.Build.0 = Debug|x64
1620
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
1721
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Release|Any CPU.Build.0 = Release|Any CPU
22+
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Release|x64.ActiveCfg = Release|x64
23+
{3379A106-E2A5-4B28-92D0-D4E37D4ABCCF}.Release|x64.Build.0 = Release|x64
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE

Form1.cs

Lines changed: 15 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,18 @@ public partial class Form1 : Form
2121
private bool InitDone = false;
2222
private string TOMLPath;
2323
private FlexGUIConfig flexGUIConfig;
24+
private System.Text.Encoding enc1252;
2425

2526
public Form1()
2627
{
2728
InitializeComponent();
2829

30+
this.Text = "FlexASIO GUI v0.2";
31+
2932
System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
3033
customCulture.NumberFormat.NumberDecimalSeparator = ".";
34+
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
35+
enc1252 = Encoding.GetEncoding(1252);
3136

3237
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
3338
CultureInfo.DefaultThreadCurrentCulture = customCulture;
@@ -48,8 +53,6 @@ public Form1()
4853
numericLatencyInput.Increment = 0.1m;
4954
numericLatencyOutput.Increment = 0.1m;
5055

51-
PortAudioInterop.Pa_Initialize();
52-
5356
for (var i=0; i<Configuration.HostApiCount; i++)
5457
{
5558
comboBackend.Items.Add(Configuration.GetHostApiInfo(i).name);
@@ -87,13 +90,21 @@ public Form1()
8790
GenerateOutput();
8891
}
8992

93+
private string W1252fromUTF(string s)
94+
{
95+
byte[] bytes = Encoding.Default.GetBytes(s);
96+
byte[] output = Encoding.Convert(Encoding.UTF8, enc1252, bytes);
97+
return Encoding.UTF8.GetString(output);
98+
}
99+
90100
private TreeNode[] GetDevicesForBackend(string Backend, bool Input)
91101
{
92102
List<TreeNode> treeNodes = new List<TreeNode>();
93103
treeNodes.Add(new TreeNode("(None)"));
94104
for (var i = 0; i < Configuration.DeviceCount; i++)
95105
{
96106
var deviceInfo = Configuration.GetDeviceInfo(i);
107+
97108
var apiInfo = Configuration.GetHostApiInfo(deviceInfo.hostApi);
98109

99110
if (apiInfo.name != Backend)
@@ -103,14 +114,14 @@ private TreeNode[] GetDevicesForBackend(string Backend, bool Input)
103114
{
104115
if (deviceInfo.maxInputChannels > 0)
105116
{
106-
treeNodes.Add(new TreeNode(deviceInfo.name));
117+
treeNodes.Add(new TreeNode(W1252fromUTF(deviceInfo.name)));
107118
}
108119
}
109120
else
110121
{
111122
if (deviceInfo.maxOutputChannels > 0)
112123
{
113-
treeNodes.Add(new TreeNode(deviceInfo.name));
124+
treeNodes.Add(new TreeNode(W1252fromUTF(deviceInfo.name)));
114125
}
115126
}
116127
}
@@ -145,46 +156,6 @@ private void GenerateOutput()
145156
{
146157
if (!InitDone) return;
147158

148-
// Old manual way of writing the config file...
149-
150-
//StringBuilder config = new StringBuilder();
151-
//var backend = comboBackend.SelectedItem.ToString();
152-
//var input = treeDevicesInput?.SelectedNode?.Text;
153-
//var output = treeDevicesOutput?.SelectedNode?.Text;
154-
//var inputLatency = numericLatencyInput.Value.ToString();
155-
//var outputLatency = numericLatencyOutput.Value.ToString();
156-
157-
//config.AppendLine($"# Host API backend");
158-
//config.AppendLine($"backend = \"{comboBackend.SelectedItem?.ToString()}\"");
159-
//config.AppendLine($"bufferSizeSamples = {numericBufferSize?.Value.ToString()}");
160-
//config.AppendLine("");
161-
//config.AppendLine($"[input]");
162-
//if (input == "(None)")
163-
// config.AppendLine($"device = \"\"");
164-
//else
165-
// config.AppendLine($"device = \"{treeDevicesInput?.SelectedNode?.Text}\"");
166-
//if (numericChannelsInput.Value > 0)
167-
//{
168-
// config.AppendLine($"channels = {numericChannelsInput?.Value.ToString()}");
169-
//}
170-
//config.AppendLine($"suggestedLatencySeconds = {numericLatencyInput?.Value.ToString("0.0", new CultureInfo("en-US"))}");
171-
//config.AppendLine($"wasapiExclusiveMode = {wasapiExclusiveInput?.Checked.ToString().ToLower()}");
172-
//config.AppendLine($"wasapiAutoConvert = {wasapiAutoConvertInput?.Checked.ToString().ToLower()}");
173-
//config.AppendLine("");
174-
//config.AppendLine($"[output]");
175-
//if (output == "(None)")
176-
// config.AppendLine($"device = \"\"");
177-
//else
178-
// config.AppendLine($"device = \"{treeDevicesOutput?.SelectedNode?.Text}\"");
179-
//if (numericChannelsOutput.Value > 0)
180-
//{
181-
// config.AppendLine($"channels = {numericChannelsOutput?.Value.ToString()}");
182-
//}
183-
//config.AppendLine($"suggestedLatencySeconds = {numericLatencyOutput?.Value.ToString("0.0", new CultureInfo("en-US"))}");
184-
//config.AppendLine($"wasapiExclusiveMode = {wasapiExclusiveOutput?.Checked.ToString().ToLower()}");
185-
//config.AppendLine($"wasapiAutoConvert = {wasapiAutoConvertOutput?.Checked.ToString().ToLower()}");
186-
//configOutput.Text = config.ToString();
187-
188159
configOutput.Clear();
189160
configOutput.Text = Toml.WriteString(flexGUIConfig);
190161
}

installer/FlexASIOGUI.iss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define MyAppName "FlexASIO GUI"
2-
#define MyAppVersion "0.1"
2+
#define MyAppVersion "0.2"
33
#define MyAppPublisher "https://github.com/flipswitchingmonkey/FlexASIO_GUI"
44
#define MyAppURL ""
55
#define MyAppExeName "FlexASIOGUI.exe"
@@ -32,7 +32,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
3232
;Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
3333

3434
[Files]
35-
Source: "..\bin\Release\netcoreapp3.1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
35+
Source: "..\bin\x64\Release\netcoreapp3.1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
3636
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
3737

3838
[Icons]

lib/portaudio_x64.dll

9 KB
Binary file not shown.

lib/portaudio_x64.pdb

2.13 MB
Binary file not shown.

0 commit comments

Comments
 (0)