From 740813a8320716733ed5064f8657c398365a6302 Mon Sep 17 00:00:00 2001 From: Abstractize Date: Thu, 3 Jul 2025 03:29:05 -0600 Subject: [PATCH 01/26] Add GUI Project --- .vscode/launch.json | 10 + drum-midi-remapper.sln | 15 + src/GUI/App.xaml | 14 + src/GUI/App.xaml.cs | 14 + src/GUI/AppShell.xaml | 14 + src/GUI/AppShell.xaml.cs | 9 + src/GUI/Extensions/StringEx.cs | 21 + src/GUI/GUI.csproj | 65 +++ src/GUI/MainPage.xaml | 34 ++ src/GUI/MainPage.xaml.cs | 89 ++++ src/GUI/MauiProgram.cs | 29 ++ src/GUI/Platforms/MacCatalyst/AppDelegate.cs | 9 + .../Platforms/MacCatalyst/Entitlements.plist | 14 + src/GUI/Platforms/MacCatalyst/Info.plist | 46 ++ src/GUI/Platforms/MacCatalyst/Program.cs | 15 + src/GUI/Platforms/Windows/App.xaml | 8 + src/GUI/Platforms/Windows/App.xaml.cs | 24 + .../Platforms/Windows/Package.appxmanifest | 46 ++ src/GUI/Platforms/Windows/app.manifest | 15 + src/GUI/Properties/launchSettings.json | 8 + src/GUI/Resources/AppIcon/appicon.svg | 4 + src/GUI/Resources/AppIcon/appiconfg.svg | 8 + src/GUI/Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107280 bytes src/GUI/Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111188 bytes src/GUI/Resources/Images/dotnet_bot.png | Bin 0 -> 93437 bytes src/GUI/Resources/Raw/AboutAssets.txt | 15 + src/GUI/Resources/Splash/splash.svg | 8 + src/GUI/Resources/Styles/Colors.xaml | 45 ++ src/GUI/Resources/Styles/Styles.xaml | 451 ++++++++++++++++++ src/Services/Services.csproj | 2 +- 30 files changed, 1031 insertions(+), 1 deletion(-) create mode 100644 src/GUI/App.xaml create mode 100644 src/GUI/App.xaml.cs create mode 100644 src/GUI/AppShell.xaml create mode 100644 src/GUI/AppShell.xaml.cs create mode 100644 src/GUI/Extensions/StringEx.cs create mode 100644 src/GUI/GUI.csproj create mode 100644 src/GUI/MainPage.xaml create mode 100644 src/GUI/MainPage.xaml.cs create mode 100644 src/GUI/MauiProgram.cs create mode 100644 src/GUI/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 src/GUI/Platforms/MacCatalyst/Entitlements.plist create mode 100644 src/GUI/Platforms/MacCatalyst/Info.plist create mode 100644 src/GUI/Platforms/MacCatalyst/Program.cs create mode 100644 src/GUI/Platforms/Windows/App.xaml create mode 100644 src/GUI/Platforms/Windows/App.xaml.cs create mode 100644 src/GUI/Platforms/Windows/Package.appxmanifest create mode 100644 src/GUI/Platforms/Windows/app.manifest create mode 100644 src/GUI/Properties/launchSettings.json create mode 100644 src/GUI/Resources/AppIcon/appicon.svg create mode 100644 src/GUI/Resources/AppIcon/appiconfg.svg create mode 100644 src/GUI/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 src/GUI/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 src/GUI/Resources/Images/dotnet_bot.png create mode 100644 src/GUI/Resources/Raw/AboutAssets.txt create mode 100644 src/GUI/Resources/Splash/splash.svg create mode 100644 src/GUI/Resources/Styles/Colors.xaml create mode 100644 src/GUI/Resources/Styles/Styles.xaml diff --git a/.vscode/launch.json b/.vscode/launch.json index 574dcbd..0b3afe1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,6 +9,16 @@ "type": "coreclr", "request": "attach" }, + { + "name": ".NET MAUI MacCatalyst Launch", + "type": "coreclr", + "request": "launch", + "program": "${workspaceFolder}/src/GUI/bin/Debug/net9.0-maccatalyst/maccatalyst-arm64/GUI.app/Contents/MacOS/GUI", + "args": [], + "cwd": "${workspaceFolder}/src/GUI", + "stopAtEntry": false, + "console": "internalConsole" + }, { "name": ".NET Core Launch (console)", "type": "coreclr", diff --git a/drum-midi-remapper.sln b/drum-midi-remapper.sln index 1f8712f..efa68ac 100644 --- a/drum-midi-remapper.sln +++ b/drum-midi-remapper.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Models.Tests", "tests\Model EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Services.Tests", "tests\Services.Tests\Services.Tests.csproj", "{3CECB972-EFFD-422B-9109-4D0D5AB6441E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GUI", "src\GUI\GUI.csproj", "{DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -115,6 +117,18 @@ Global {3CECB972-EFFD-422B-9109-4D0D5AB6441E}.Release|x64.Build.0 = Release|Any CPU {3CECB972-EFFD-422B-9109-4D0D5AB6441E}.Release|x86.ActiveCfg = Release|Any CPU {3CECB972-EFFD-422B-9109-4D0D5AB6441E}.Release|x86.Build.0 = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|x64.ActiveCfg = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|x64.Build.0 = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|x86.ActiveCfg = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Debug|x86.Build.0 = Debug|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|Any CPU.Build.0 = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|x64.ActiveCfg = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|x64.Build.0 = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|x86.ActiveCfg = Release|Any CPU + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -127,5 +141,6 @@ Global {04A8B018-1954-48B8-BAAF-E17385114845} = {0AB3BF05-4346-4AA6-1389-037BE0695223} {C3C581BD-E5DE-4CC4-B9A5-9F76602C69A4} = {0AB3BF05-4346-4AA6-1389-037BE0695223} {3CECB972-EFFD-422B-9109-4D0D5AB6441E} = {0AB3BF05-4346-4AA6-1389-037BE0695223} + {DAAAD64C-D0A8-4FE9-AB6B-54447C10960F} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} EndGlobalSection EndGlobal diff --git a/src/GUI/App.xaml b/src/GUI/App.xaml new file mode 100644 index 0000000..695f39c --- /dev/null +++ b/src/GUI/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/src/GUI/App.xaml.cs b/src/GUI/App.xaml.cs new file mode 100644 index 0000000..676e16c --- /dev/null +++ b/src/GUI/App.xaml.cs @@ -0,0 +1,14 @@ +namespace GUI; + +public partial class App : Application +{ + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); + } +} \ No newline at end of file diff --git a/src/GUI/AppShell.xaml b/src/GUI/AppShell.xaml new file mode 100644 index 0000000..f931a47 --- /dev/null +++ b/src/GUI/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/src/GUI/AppShell.xaml.cs b/src/GUI/AppShell.xaml.cs new file mode 100644 index 0000000..102cd85 --- /dev/null +++ b/src/GUI/AppShell.xaml.cs @@ -0,0 +1,9 @@ +namespace GUI; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + } +} diff --git a/src/GUI/Extensions/StringEx.cs b/src/GUI/Extensions/StringEx.cs new file mode 100644 index 0000000..13786cc --- /dev/null +++ b/src/GUI/Extensions/StringEx.cs @@ -0,0 +1,21 @@ +using System.Text.RegularExpressions; + +namespace GUI.Extensions; + +public static partial class StringEx +{ + public static string PascalCaseToUpperWithSpaces(this string input) + { + if (string.IsNullOrEmpty(input)) + return string.Empty; + + // Insert space before each uppercase letter that is not the first + string withSpaces = MyRegex().Replace(input, " $1"); + + // Convert everything to uppercase + return withSpaces.ToUpper(); + } + + [GeneratedRegex("(? + + + net9.0-maccatalyst + + + + + Exe + GUI + true + true + enable + enable + + + GUI + + + com.companyname.gui + + + 1.0 + 1 + + + None + + 15.0 + 10.0.17763.0 + 10.0.17763.0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/GUI/MainPage.xaml b/src/GUI/MainPage.xaml new file mode 100644 index 0000000..2f02037 --- /dev/null +++ b/src/GUI/MainPage.xaml @@ -0,0 +1,34 @@ + + + + +