-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1324a77
commit 2545167
Showing
3 changed files
with
297 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/ChromaControl.SDK.OpenRGB/Extensions/JsonNodeExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Licensed to the Chroma Control Contributors under one or more agreements. | ||
// The Chroma Control Contributors licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Text.Json; | ||
using System.Text.Json.Nodes; | ||
|
||
namespace ChromaControl.SDK.OpenRGB.Extensions; | ||
|
||
internal static class JsonNodeExtensions | ||
{ | ||
public static void Merge(this JsonNode current, JsonNode merge) | ||
{ | ||
var mergeObject = merge.AsObject(); | ||
|
||
foreach (var mergeNode in mergeObject) | ||
{ | ||
if (mergeNode.Value is null) | ||
{ | ||
current[mergeNode.Key] = null; | ||
} | ||
else | ||
{ | ||
if (current[mergeNode.Key] is null) | ||
{ | ||
current[mergeNode.Key] = mergeNode.Value.DeepClone(); | ||
} | ||
else | ||
{ | ||
if (mergeNode.Value.GetValueKind() is JsonValueKind.Object) | ||
{ | ||
current[mergeNode.Key]!.Merge(mergeNode.Value); | ||
} | ||
else | ||
{ | ||
current[mergeNode.Key] = mergeNode.Value.DeepClone(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
184 changes: 184 additions & 0 deletions
184
src/ChromaControl.SDK.OpenRGB/Internal/OpenRGBConstants.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
// Licensed to the Chroma Control Contributors under one or more agreements. | ||
// The Chroma Control Contributors licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Immutable; | ||
|
||
namespace ChromaControl.SDK.OpenRGB.Internal; | ||
|
||
internal sealed class OpenRGBConstants | ||
{ | ||
public static readonly string DataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ChromaControl"); | ||
public static readonly string ConfigPath = Path.Combine(DataPath, "config"); | ||
|
||
public static readonly ImmutableList<string> DisabledDetectors = | ||
[ | ||
"Lian Li O11 Dynamic - Razer Edition", | ||
"Razer Abyssus Elite D.Va Edition", | ||
"Razer Abyssus Essential", | ||
"Razer Base Station Chroma", | ||
"Razer Base Station V2 Chroma", | ||
"Razer Basilisk", | ||
"Razer Basilisk Essential", | ||
"Razer Basilisk Ultimate (Wired)", | ||
"Razer Basilisk Ultimate (Wireless)", | ||
"Razer Basilisk V2", | ||
"Razer Basilisk V3", | ||
"Razer Basilisk V3 Pro (Wired)", | ||
"Razer Basilisk V3 Pro (Wireless)", | ||
"Razer Basilisk V3 X HyperSpeed", | ||
"Razer Blackwidow 2019", | ||
"Razer Blackwidow Chroma", | ||
"Razer Blackwidow Chroma Tournament Edition", | ||
"Razer Blackwidow Chroma V2", | ||
"Razer Blackwidow Elite", | ||
"Razer Blackwidow Overwatch", | ||
"Razer Blackwidow V3", | ||
"Razer Blackwidow V3 Mini (Wired)", | ||
"Razer Blackwidow V3 Mini (Wireless)", | ||
"Razer Blackwidow V3 Pro (Wired)", | ||
"Razer Blackwidow V3 Pro (Wireless)", | ||
"Razer Blackwidow V3 TKL", | ||
"Razer Blackwidow V4", | ||
"Razer Blackwidow V4 Pro", | ||
"Razer Blackwidow V4 X", | ||
"Razer Blackwidow X Chroma", | ||
"Razer Blackwidow X Chroma Tournament Edition", | ||
"Razer Blade (2016)", | ||
"Razer Blade (Late 2016)", | ||
"Razer Blade 14 (2021)", | ||
"Razer Blade 14 (2022)", | ||
"Razer Blade 14 (2023)", | ||
"Razer Blade 15 (2018 Advanced)", | ||
"Razer Blade 15 (2018 Base)", | ||
"Razer Blade 15 (2018 Mercury)", | ||
"Razer Blade 15 (2019 Advanced)", | ||
"Razer Blade 15 (2019 Base)", | ||
"Razer Blade 15 (2019 Mercury)", | ||
"Razer Blade 15 (2019 Studio)", | ||
"Razer Blade 15 (2020 Advanced)", | ||
"Razer Blade 15 (2020 Base)", | ||
"Razer Blade 15 (2021 Advanced)", | ||
"Razer Blade 15 (2021 Base)", | ||
"Razer Blade 15 (2022)", | ||
"Razer Blade 15 (Late 2020)", | ||
"Razer Blade 15 (Late 2021 Advanced)", | ||
"Razer Blade Pro (2016)", | ||
"Razer Blade Pro (2017 FullHD)", | ||
"Razer Blade Pro (2017)", | ||
"Razer Blade Pro (2019)", | ||
"Razer Blade Pro (Late 2019)", | ||
"Razer Blade Pro 17 (2020)", | ||
"Razer Blade Pro 17 (2021)", | ||
"Razer Blade Stealth (2016)", | ||
"Razer Blade Stealth (2017)", | ||
"Razer Blade Stealth (2019)", | ||
"Razer Blade Stealth (2020)", | ||
"Razer Blade Stealth (Late 2016)", | ||
"Razer Blade Stealth (Late 2017)", | ||
"Razer Blade Stealth (Late 2019)", | ||
"Razer Blade Stealth (Late 2020)", | ||
"Razer Book 13 (2020)", | ||
"Razer Charging Pad Chroma", | ||
"Razer Chroma Addressable RGB Controller", | ||
"Razer Chroma HDK", | ||
"Razer Chroma Mug Holder", | ||
"Razer Chroma PC Case Lighting Kit", | ||
"Razer Cobra", | ||
"Razer Core", | ||
"Razer Core X", | ||
"Razer Cynosa Chroma", | ||
"Razer Cynosa Chroma V2", | ||
"Razer Cynosa Lite", | ||
"Razer Deathadder Chroma", | ||
"Razer Deathadder Elite", | ||
"Razer Deathadder Essential", | ||
"Razer Deathadder Essential V2", | ||
"Razer Deathadder Essential White Edition", | ||
"Razer Deathadder V2", | ||
"Razer Deathadder V2 Mini", | ||
"Razer Deathadder V2 Pro (Wired)", | ||
"Razer Deathadder V2 Pro (Wireless)", | ||
"Razer Deathstalker Chroma", | ||
"Razer Deathstalker V2", | ||
"Razer Deathstalker V2 Pro (Wired)", | ||
"Razer Deathstalker V2 Pro (Wireless)", | ||
"Razer Deathstalker V2 Pro TKL (Wired)", | ||
"Razer Deathstalker V2 Pro TKL (Wireless)", | ||
"Razer Diamondback", | ||
"Razer Firefly", | ||
"Razer Firefly Hyperflux", | ||
"Razer Firefly V2", | ||
"Razer Goliathus", | ||
"Razer Goliathus Chroma 3XL", | ||
"Razer Goliathus Extended", | ||
"Razer Huntsman", | ||
"Razer Huntsman Elite", | ||
"Razer Huntsman Mini", | ||
"Razer Huntsman Mini Analog", | ||
"Razer Huntsman Tournament Edition", | ||
"Razer Huntsman V2", | ||
"Razer Huntsman V2 Analog", | ||
"Razer Huntsman V2 TKL", | ||
"Razer Kraken 7.1", | ||
"Razer Kraken 7.1 Chroma", | ||
"Razer Kraken 7.1 V2", | ||
"Razer Kraken Kitty Black Edition", | ||
"Razer Kraken Kitty Black Edition V2", | ||
"Razer Kraken Kitty Edition", | ||
"Razer Kraken Ultimate", | ||
"Razer Lancehead 2017 (Wired)", | ||
"Razer Lancehead 2017 (Wireless)", | ||
"Razer Lancehead 2019 (Wired)", | ||
"Razer Lancehead 2019 (Wireless)", | ||
"Razer Lancehead Tournament Edition", | ||
"Razer Laptop Stand Chroma", | ||
"Razer Laptop Stand Chroma V2", | ||
"Razer Leviathan V2", | ||
"Razer Leviathan V2 X", | ||
"Razer Mamba 2012 (Wired)", | ||
"Razer Mamba 2012 (Wireless)", | ||
"Razer Mamba 2015 (Wired)", | ||
"Razer Mamba 2015 (Wireless)", | ||
"Razer Mamba 2018 (Wired)", | ||
"Razer Mamba 2018 (Wireless)", | ||
"Razer Mamba Elite", | ||
"Razer Mamba Hyperflux (Wired)", | ||
"Razer Mamba Tournament Edition", | ||
"Razer Mouse Bungee V3 Chroma", | ||
"Razer Mouse Dock Chroma", | ||
"Razer Mouse Dock Pro", | ||
"Razer Naga Chroma", | ||
"Razer Naga Classic", | ||
"Razer Naga Epic Chroma", | ||
"Razer Naga Hex V2", | ||
"Razer Naga Left Handed", | ||
"Razer Naga Pro (Wired)", | ||
"Razer Naga Pro (Wireless)", | ||
"Razer Naga Pro V2 (Wired)", | ||
"Razer Naga Pro V2 (Wireless)", | ||
"Razer Naga Trinity", | ||
"Razer Nommo Chroma", | ||
"Razer Nommo Pro", | ||
"Razer Orbweaver Chroma", | ||
"Razer Ornata Chroma", | ||
"Razer Ornata Chroma V2", | ||
"Razer Ornata V3", | ||
"Razer Ornata V3 Rev2", | ||
"Razer Ornata V3 TKL", | ||
"Razer Ornata V3 X", | ||
"Razer Ornata V3 X Rev2", | ||
"Razer Seiren Emote", | ||
"Razer Strider Chroma", | ||
"Razer Tartarus Chroma", | ||
"Razer Tartarus Pro", | ||
"Razer Tartarus V2", | ||
"Razer Thunderbolt 4 Dock Chroma", | ||
"Razer Tiamat 7.1 V2", | ||
"Razer Viper", | ||
"Razer Viper 8kHz", | ||
"Razer Viper Mini", | ||
"Razer Viper Ultimate (Wired)", | ||
"Razer Viper Ultimate (Wireless)", | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters