From ae9fbc6d97294e1638e9ca08ad9ccb479b36b814 Mon Sep 17 00:00:00 2001 From: Dunestorm Date: Sun, 27 Mar 2022 11:04:13 +0100 Subject: [PATCH] HeadMeld 0.0.0.1 - Initial submit, functionality is incomplete --- .gitignore | 3 + App.xaml | 17 ++++ App.xaml.cs | 17 ++++ AssemblyInfo.cs | 10 +++ ConfigManager.cs | 47 +++++++++++ HeadMeld.csproj | 47 +++++++++++ HeadMeld.csproj.user | 22 +++++ HeadMeld.sln | 25 ++++++ MainWindow.xaml | 22 +++++ MainWindow.xaml.cs | 55 +++++++++++++ Resources.Designer.cs | 103 ++++++++++++++++++++++++ Resources.resx | 133 +++++++++++++++++++++++++++++++ Resources/headphones_dark.ico | Bin 0 -> 4286 bytes Resources/headphones_dark.png | Bin 0 -> 1520 bytes Resources/headphones_light.ico | Bin 0 -> 4286 bytes Resources/headphones_light.png | Bin 0 -> 3243 bytes Resources/loudspeakers_dark.ico | Bin 0 -> 4286 bytes Resources/loudspeakers_dark.png | Bin 0 -> 1435 bytes Resources/loudspeakers_light.ico | Bin 0 -> 4286 bytes Resources/loudspeakers_light.png | Bin 0 -> 3262 bytes Startup.xaml | 8 ++ Startup.xaml.cs | 54 +++++++++++++ TrayManager.cs | 50 ++++++++++++ 23 files changed, 613 insertions(+) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 AssemblyInfo.cs create mode 100644 ConfigManager.cs create mode 100644 HeadMeld.csproj create mode 100644 HeadMeld.csproj.user create mode 100644 HeadMeld.sln create mode 100644 MainWindow.xaml create mode 100644 MainWindow.xaml.cs create mode 100644 Resources.Designer.cs create mode 100644 Resources.resx create mode 100644 Resources/headphones_dark.ico create mode 100644 Resources/headphones_dark.png create mode 100644 Resources/headphones_light.ico create mode 100644 Resources/headphones_light.png create mode 100644 Resources/loudspeakers_dark.ico create mode 100644 Resources/loudspeakers_dark.png create mode 100644 Resources/loudspeakers_light.ico create mode 100644 Resources/loudspeakers_light.png create mode 100644 Startup.xaml create mode 100644 Startup.xaml.cs create mode 100644 TrayManager.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..882890a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +obj +bin +.vs diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..ec0918d --- /dev/null +++ b/App.xaml @@ -0,0 +1,17 @@ + + + + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..7f21d60 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace HeadMeld +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/ConfigManager.cs b/ConfigManager.cs new file mode 100644 index 0000000..f331703 --- /dev/null +++ b/ConfigManager.cs @@ -0,0 +1,47 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace HeadMeld +{ + internal class ConfigManager + { + private readonly string configPath = @"C:\Program Files\EqualizerAPO\config\config.txt"; + internal List configFile = new(); + public ConfigManager() + { + configFile = File.ReadAllLines(configPath).ToList(); + /* + ToggleProfiles(new List + { + "# Include: ATH-M50x.txt", + "Include: 900ProX.txt" + }, false); + Write(); + */ + } + + public void Write() + { + File.WriteAllLines(configPath, configFile); + } + + public void ToggleProfiles(List profiles, bool enableProfile) + { + foreach (var profile in profiles) + { + string rawProfile = profile.Replace("# ", string.Empty); + var filter = configFile.FindIndex(x => x.Contains(rawProfile)); + + if (enableProfile) + { + configFile[filter] = rawProfile.Replace("# ", string.Empty); + } + else + { + configFile[filter] = rawProfile.Insert(0, "# "); + } + } + } + } +} diff --git a/HeadMeld.csproj b/HeadMeld.csproj new file mode 100644 index 0000000..9c8d19d --- /dev/null +++ b/HeadMeld.csproj @@ -0,0 +1,47 @@ + + + + WinExe + net5.0-windows10.0.18362.0 + enable + true + 0.0.0.1 + 0.0.0.1 + + + + + + + + + + True + True + Resources.resx + + + + + + PublicResXFileCodeGenerator + Resources.Designer.cs + + + + + + Always + + + Always + + + Always + + + Always + + + + diff --git a/HeadMeld.csproj.user b/HeadMeld.csproj.user new file mode 100644 index 0000000..b34fcfe --- /dev/null +++ b/HeadMeld.csproj.user @@ -0,0 +1,22 @@ + + + + + + Designer + + + + + Code + + + + + Designer + + + Designer + + + \ No newline at end of file diff --git a/HeadMeld.sln b/HeadMeld.sln new file mode 100644 index 0000000..8d9be81 --- /dev/null +++ b/HeadMeld.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32319.34 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeadMeld", "HeadMeld.csproj", "{59252E1F-C598-4A62-8E03-26ED4D1468EF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59252E1F-C598-4A62-8E03-26ED4D1468EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59252E1F-C598-4A62-8E03-26ED4D1468EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59252E1F-C598-4A62-8E03-26ED4D1468EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59252E1F-C598-4A62-8E03-26ED4D1468EF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9D75AEA6-B515-4F8F-B62E-5814099D0232} + EndGlobalSection +EndGlobal diff --git a/MainWindow.xaml b/MainWindow.xaml new file mode 100644 index 0000000..13a0fa6 --- /dev/null +++ b/MainWindow.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + +