From bdcb70d685e8d055ff968b5ea2bcf58ed805107d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Thu, 8 Dec 2022 20:57:20 +0100 Subject: [PATCH] Split `Profiles` into `Profiles/Default` and `Profiles/Predefined` --- SteamController/Controller.cs | 9 ++++----- .../BackPanelShortcutsProfile.cs} | 4 ++-- .../GuideShortcutsProfile.cs} | 5 ++--- .../ShortcutsProfile.cs} | 7 ++----- .../Profiles/{ => Predefined}/DesktopProfile.cs | 4 ++-- .../Profiles/{ => Predefined}/SteamProfile.cs | 6 ++---- .../{ => Predefined}/SteamWithShorcutsProfile.cs | 4 ++-- .../Profiles/{ => Predefined}/X360HapticProfile.cs | 2 +- SteamController/Profiles/{ => Predefined}/X360Profile.cs | 4 ++-- 9 files changed, 19 insertions(+), 26 deletions(-) rename SteamController/Profiles/{DefaultBackPanelShortcutsProfile.cs => Default/BackPanelShortcutsProfile.cs} (86%) rename SteamController/Profiles/{DefaultGuideShortcutsProfile.cs => Default/GuideShortcutsProfile.cs} (97%) rename SteamController/Profiles/{DefaultShortcutsProfile.cs => Default/ShortcutsProfile.cs} (93%) rename SteamController/Profiles/{ => Predefined}/DesktopProfile.cs (94%) rename SteamController/Profiles/{ => Predefined}/SteamProfile.cs (82%) rename SteamController/Profiles/{ => Predefined}/SteamWithShorcutsProfile.cs (83%) rename SteamController/Profiles/{ => Predefined}/X360HapticProfile.cs (96%) rename SteamController/Profiles/{ => Predefined}/X360Profile.cs (96%) diff --git a/SteamController/Controller.cs b/SteamController/Controller.cs index 0f7fdcd..277fb9b 100644 --- a/SteamController/Controller.cs +++ b/SteamController/Controller.cs @@ -1,6 +1,5 @@ using CommonHelpers; using ExternalHelpers; -using SteamController.Profiles; using System.ComponentModel; using System.Diagnostics; @@ -18,10 +17,10 @@ namespace SteamController Context context = new Context() { Profiles = { - new Profiles.DesktopProfile() { Name = "Desktop" }, - new Profiles.SteamProfile() { Name = "Steam", Visible = false }, - new Profiles.SteamWithShorcutsProfile() { Name = "Steam with Shortcuts", Visible = false }, - new Profiles.X360HapticProfile() { Name = "X360" } + new Profiles.Predefined.DesktopProfile() { Name = "Desktop" }, + new Profiles.Predefined.SteamProfile() { Name = "Steam", Visible = false }, + new Profiles.Predefined.SteamWithShorcutsProfile() { Name = "Steam with Shortcuts", Visible = false }, + new Profiles.Predefined.X360HapticProfile() { Name = "X360" } }, Managers = { new Managers.ProcessManager(), diff --git a/SteamController/Profiles/DefaultBackPanelShortcutsProfile.cs b/SteamController/Profiles/Default/BackPanelShortcutsProfile.cs similarity index 86% rename from SteamController/Profiles/DefaultBackPanelShortcutsProfile.cs rename to SteamController/Profiles/Default/BackPanelShortcutsProfile.cs index 5c9b7cd..66c84f2 100644 --- a/SteamController/Profiles/DefaultBackPanelShortcutsProfile.cs +++ b/SteamController/Profiles/Default/BackPanelShortcutsProfile.cs @@ -1,8 +1,8 @@ using SteamController.ProfilesSettings; -namespace SteamController.Profiles +namespace SteamController.Profiles.Default { - public abstract class DefaultBackPanelShortcutsProfile : DefaultGuideShortcutsProfile + public abstract class BackPanelShortcutsProfile : GuideShortcutsProfile { internal abstract ProfilesSettings.BackPanelSettings BackPanelSettings { get; } diff --git a/SteamController/Profiles/DefaultGuideShortcutsProfile.cs b/SteamController/Profiles/Default/GuideShortcutsProfile.cs similarity index 97% rename from SteamController/Profiles/DefaultGuideShortcutsProfile.cs rename to SteamController/Profiles/Default/GuideShortcutsProfile.cs index 360986a..ae8aa78 100644 --- a/SteamController/Profiles/DefaultGuideShortcutsProfile.cs +++ b/SteamController/Profiles/Default/GuideShortcutsProfile.cs @@ -1,12 +1,11 @@ using System.Diagnostics; -using System.Runtime.InteropServices; using ExternalHelpers; using PowerControl.Helpers; using WindowsInput; -namespace SteamController.Profiles +namespace SteamController.Profiles.Default { - public abstract class DefaultGuideShortcutsProfile : DefaultShortcutsProfile + public abstract class GuideShortcutsProfile : ShortcutsProfile { public readonly TimeSpan HoldForKill = TimeSpan.FromSeconds(3); public readonly TimeSpan HoldForClose = TimeSpan.FromSeconds(1); diff --git a/SteamController/Profiles/DefaultShortcutsProfile.cs b/SteamController/Profiles/Default/ShortcutsProfile.cs similarity index 93% rename from SteamController/Profiles/DefaultShortcutsProfile.cs rename to SteamController/Profiles/Default/ShortcutsProfile.cs index e6dbed3..fc773bc 100644 --- a/SteamController/Profiles/DefaultShortcutsProfile.cs +++ b/SteamController/Profiles/Default/ShortcutsProfile.cs @@ -1,11 +1,8 @@ -using System.Diagnostics; -using System.Runtime.InteropServices; -using ExternalHelpers; using WindowsInput; -namespace SteamController.Profiles +namespace SteamController.Profiles.Default { - public abstract class DefaultShortcutsProfile : Profile + public abstract class ShortcutsProfile : Profile { public const String ShortcutConsumed = "ShortcutsProfile"; public readonly TimeSpan HoldForShorcuts = TimeSpan.FromMilliseconds(200); diff --git a/SteamController/Profiles/DesktopProfile.cs b/SteamController/Profiles/Predefined/DesktopProfile.cs similarity index 94% rename from SteamController/Profiles/DesktopProfile.cs rename to SteamController/Profiles/Predefined/DesktopProfile.cs index 64d3ce0..19d7e35 100644 --- a/SteamController/Profiles/DesktopProfile.cs +++ b/SteamController/Profiles/Predefined/DesktopProfile.cs @@ -1,8 +1,8 @@ using WindowsInput; -namespace SteamController.Profiles +namespace SteamController.Profiles.Predefined { - public sealed class DesktopProfile : DefaultBackPanelShortcutsProfile + public sealed class DesktopProfile : Default.BackPanelShortcutsProfile { private const String Consumed = "DesktopProfileOwner"; diff --git a/SteamController/Profiles/SteamProfile.cs b/SteamController/Profiles/Predefined/SteamProfile.cs similarity index 82% rename from SteamController/Profiles/SteamProfile.cs rename to SteamController/Profiles/Predefined/SteamProfile.cs index 98be571..44c45c5 100644 --- a/SteamController/Profiles/SteamProfile.cs +++ b/SteamController/Profiles/Predefined/SteamProfile.cs @@ -1,8 +1,6 @@ -using Nefarius.ViGEm.Client.Targets.Xbox360; - -namespace SteamController.Profiles +namespace SteamController.Profiles.Predefined { - public sealed class SteamProfile : DefaultShortcutsProfile + public sealed class SteamProfile : Default.ShortcutsProfile { public SteamProfile() { diff --git a/SteamController/Profiles/SteamWithShorcutsProfile.cs b/SteamController/Profiles/Predefined/SteamWithShorcutsProfile.cs similarity index 83% rename from SteamController/Profiles/SteamWithShorcutsProfile.cs rename to SteamController/Profiles/Predefined/SteamWithShorcutsProfile.cs index 19bac3b..85f0340 100644 --- a/SteamController/Profiles/SteamWithShorcutsProfile.cs +++ b/SteamController/Profiles/Predefined/SteamWithShorcutsProfile.cs @@ -1,8 +1,8 @@ using Nefarius.ViGEm.Client.Targets.Xbox360; -namespace SteamController.Profiles +namespace SteamController.Profiles.Predefined { - public sealed class SteamWithShorcutsProfile : DefaultGuideShortcutsProfile + public sealed class SteamWithShorcutsProfile : Default.GuideShortcutsProfile { public SteamWithShorcutsProfile() { diff --git a/SteamController/Profiles/X360HapticProfile.cs b/SteamController/Profiles/Predefined/X360HapticProfile.cs similarity index 96% rename from SteamController/Profiles/X360HapticProfile.cs rename to SteamController/Profiles/Predefined/X360HapticProfile.cs index a1321b4..a618ef6 100644 --- a/SteamController/Profiles/X360HapticProfile.cs +++ b/SteamController/Profiles/Predefined/X360HapticProfile.cs @@ -1,7 +1,7 @@ using SteamController.ProfilesSettings; using HapticPad = SteamController.Devices.SteamController.HapticPad; -namespace SteamController.Profiles +namespace SteamController.Profiles.Predefined { public class X360HapticProfile : X360Profile { diff --git a/SteamController/Profiles/X360Profile.cs b/SteamController/Profiles/Predefined/X360Profile.cs similarity index 96% rename from SteamController/Profiles/X360Profile.cs rename to SteamController/Profiles/Predefined/X360Profile.cs index cc45c91..9cbc042 100644 --- a/SteamController/Profiles/X360Profile.cs +++ b/SteamController/Profiles/Predefined/X360Profile.cs @@ -1,9 +1,9 @@ using Nefarius.ViGEm.Client.Targets.Xbox360; using SteamController.ProfilesSettings; -namespace SteamController.Profiles +namespace SteamController.Profiles.Predefined { - public class X360Profile : DefaultBackPanelShortcutsProfile + public class X360Profile : Default.BackPanelShortcutsProfile { public override bool Selected(Context context) {