├── .gitignore
├── CUEORGBPlugin.sln
├── CUEORGBPlugin.vcxproj
├── CUEORGBPlugin.vcxproj.filters
├── CUESDKDevice.h
├── CorsairPluginDevice.cpp
├── CorsairPluginDevice.h
├── CorsairPluginDeviceManager.cpp
├── CorsairPluginDeviceManager.h
├── LICENSE
├── OpenRGBClient
├── OpenRGBClient.cpp
├── OpenRGBClient.vcxproj
└── OpenRGBClient.vcxproj.filters
├── README.md
├── dist
└── plugins
│ └── OpenRGB
│ ├── devices.json
│ ├── images
│ ├── gpu
│ │ └── default
│ │ │ ├── device_view.png
│ │ │ ├── promo.png
│ │ │ └── thumbnail.png
│ ├── keyboard
│ │ └── default
│ │ │ ├── device_view.jpg
│ │ │ ├── device_view_mask.png
│ │ │ ├── promo.jpg
│ │ │ └── thumbnail.png
│ ├── led_strip
│ │ └── default
│ │ │ └── device_view.png
│ └── motherboard
│ │ └── default
│ │ ├── device_view.png
│ │ ├── promo.png
│ │ └── thumbnail.png
│ └── settings.json
├── dllmain.cpp
├── exports.def
├── screenshots
├── custom_device.png
├── custom_device_v4.PNG
└── open_rgb_server.PNG
├── thirdparty
├── CUESDK
│ └── CorsairLedIdEnum.h
├── MinHook
│ ├── include
│ │ └── MinHook.h
│ └── src
│ │ ├── buffer.c
│ │ ├── buffer.h
│ │ ├── hde
│ │ ├── hde32.c
│ │ ├── hde32.h
│ │ ├── hde64.c
│ │ ├── hde64.h
│ │ ├── pstdint.h
│ │ ├── table32.h
│ │ └── table64.h
│ │ ├── hook.c
│ │ ├── trampoline.c
│ │ └── trampoline.h
├── OpenRGB
│ ├── NetworkClient.cpp
│ ├── NetworkClient.h
│ ├── NetworkProtocol.cpp
│ ├── NetworkProtocol.h
│ ├── RGBController
│ │ ├── RGBController.cpp
│ │ ├── RGBController.h
│ │ ├── RGBController_Network.cpp
│ │ └── RGBController_Network.h
│ └── net_port
│ │ ├── net_port.cpp
│ │ └── net_port.h
├── json
│ └── json.hpp
└── sha256
│ └── picosha2.h
├── version_wrapper
├── dllmain.cpp
├── version.def
├── version_wrapper.vcxproj
└── version_wrapper.vcxproj.filters
└── wrapper
├── dllmain.cpp
├── dsound.def
├── wrapper.vcxproj
└── wrapper.vcxproj.filters
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *.db
3 | *.db-shm
4 | .vs/CUEORGBPlugin/v16/.suo
5 | .vs/CUEORGBPlugin/v16/Browse.VC.db-wal
6 | .vs/CUEORGBPlugin/v16/Browse.VC.opendb
7 | .vs/CUEORGBPlugin/v16/ipch/1ec06a64a6c4f86.ipch
8 | .vs/CUEORGBPlugin/v16/ipch/68643e07a70ce213.ipch
9 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/11ce7df6f0d933d/HOOK.ipch
10 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/306beae86944fa4/BUFFER.ipch
11 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/3c92720a49927499/DLLMAIN.ipch
12 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/4c08ecadff7d1e2e/RGBCONTROLLER.ipch
13 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/61e22fdb9b9d237f/RGBCONTROLLER_NETWORK.ipch
14 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/6db90fc3c31aa1d3/NETWORKCLIENT.ipch
15 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/757f2cce72e2e9ea/DLLMAIN.ipch
16 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/83027e4f9a54a6e6/MINHOOK.ipch
17 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/d7138a543be9ede/CORSAIRPLUGINDEVICE.ipch
18 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/d9129b772a1e2a9f/CORSAIRPLUGINDEVICEMANAGER.ipch
19 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/df49c5c67e15d04d/CORSAIRPLUGINDEVICEMANAGER.ipch
20 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/e53d65a3158db21c/DLLMAIN.ipch
21 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/f6cd0d56c2d1344f/DLLMAIN.ipch
22 | .vs/CUEORGBPlugin/v16/ipch/AutoPCH/f9f36af27f6193b3/HOOK.ipch
23 | CUEORGBPlugin.vcxproj.user
24 | Debug/CorsairPluginDevice.obj
25 | Debug/CorsairPluginDeviceManager.obj
26 | Debug/CUEORGBPlugin.dll
27 | Debug/CUEORGBPlugin.dll.recipe
28 | Debug/CUEORGBPlugin.exp
29 | Debug/CUEORGBPlugin.ilk
30 | Debug/CUEORGBPlugin.lib
31 | Debug/CUEORGBPlugin.log
32 | Debug/CUEORGBPlugin.pdb
33 | Debug/CUEORGBPlugin.tlog/CL.command.1.tlog
34 | Debug/CUEORGBPlugin.tlog/CL.read.1.tlog
35 | Debug/CUEORGBPlugin.tlog/CL.write.1.tlog
36 | Debug/CUEORGBPlugin.tlog/CUEORGBPlugin.lastbuildstate
37 | Debug/CUEORGBPlugin.tlog/CUEORGBPlugin.write.1u.tlog
38 | Debug/CUEORGBPlugin.tlog/link.34804.delete.1.tlog
39 | Debug/CUEORGBPlugin.tlog/link.command.1.tlog
40 | Debug/CUEORGBPlugin.tlog/link.read.1.tlog
41 | Debug/CUEORGBPlugin.tlog/link.write.1.tlog
42 | Debug/CUEORGBPlugin.vcxproj.FileListAbsolute.txt
43 | Debug/dllmain.obj
44 | Debug/dsound.dll
45 | Debug/dsound.exp
46 | Debug/dsound.ilk
47 | Debug/dsound.lib
48 | Debug/dsound.pdb
49 | Debug/net_port.obj
50 | Debug/NetworkClient.obj
51 | Debug/NetworkProtocol.obj
52 | Debug/RGBController.obj
53 | Debug/RGBController_Network.obj
54 | Debug/vc142.idb
55 | Debug/vc142.pdb
56 | Debug/wrapper.dll
57 | Debug/wrapper.exp
58 | Debug/wrapper.ilk
59 | Debug/wrapper.lib
60 | Debug/wrapper.pdb
61 | Release/CorsairPluginDevice.obj
62 | Release/CorsairPluginDeviceManager.obj
63 | Release/CUEORGBPlugin.dll
64 | Release/CUEORGBPlugin.dll.recipe
65 | Release/CUEORGBPlugin.exp
66 | Release/CUEORGBPlugin.iobj
67 | Release/CUEORGBPlugin.ipdb
68 | Release/CUEORGBPlugin.lib
69 | Release/CUEORGBPlugin.log
70 | Release/CUEORGBPlugin.pdb
71 | Release/CUEORGBPlugin.tlog/CL.command.1.tlog
72 | Release/CUEORGBPlugin.tlog/CL.read.1.tlog
73 | Release/CUEORGBPlugin.tlog/CL.write.1.tlog
74 | Release/CUEORGBPlugin.tlog/CUEORGBPlugin.lastbuildstate
75 | Release/CUEORGBPlugin.tlog/CUEORGBPlugin.write.1u.tlog
76 | Release/CUEORGBPlugin.tlog/link.command.1.tlog
77 | Release/CUEORGBPlugin.tlog/link.delete.1.tlog
78 | Release/CUEORGBPlugin.tlog/link.read.1.tlog
79 | Release/CUEORGBPlugin.tlog/link.write.1.tlog
80 | Release/CUEORGBPlugin.vcxproj.FileListAbsolute.txt
81 | Release/dllmain.obj
82 | Release/dsound.dll
83 | Release/dsound.exp
84 | Release/dsound.iobj
85 | Release/dsound.ipdb
86 | Release/dsound.lib
87 | Release/dsound.pdb
88 | Release/net_port.obj
89 | Release/NetworkClient.obj
90 | Release/NetworkProtocol.obj
91 | Release/RGBController.obj
92 | Release/RGBController_Network.obj
93 | Release/vc142.pdb
94 | wrapper/Debug/buffer.obj
95 | wrapper/Debug/dllmain.obj
96 | wrapper/Debug/dsound.dll.recipe
97 | wrapper/Debug/hde32.obj
98 | wrapper/Debug/hde64.obj
99 | wrapper/Debug/hook.obj
100 | wrapper/Debug/trampoline.obj
101 | wrapper/Debug/vc142.idb
102 | wrapper/Debug/vc142.pdb
103 | wrapper/Debug/wrapper.log
104 | wrapper/Debug/wrapper.tlog/CL.command.1.tlog
105 | wrapper/Debug/wrapper.tlog/CL.read.1.tlog
106 | wrapper/Debug/wrapper.tlog/CL.write.1.tlog
107 | wrapper/Debug/wrapper.tlog/link.command.1.tlog
108 | wrapper/Debug/wrapper.tlog/link.read.1.tlog
109 | wrapper/Debug/wrapper.tlog/link.write.1.tlog
110 | wrapper/Debug/wrapper.tlog/wrapper.lastbuildstate
111 | wrapper/Debug/wrapper.tlog/wrapper.write.1u.tlog
112 | wrapper/Release/buffer.obj
113 | wrapper/Release/dllmain.obj
114 | wrapper/Release/dsound.dll.recipe
115 | wrapper/Release/hde32.obj
116 | wrapper/Release/hde64.obj
117 | wrapper/Release/hook.obj
118 | wrapper/Release/trampoline.obj
119 | wrapper/Release/vc142.pdb
120 | wrapper/Release/wrapper.log
121 | wrapper/Release/wrapper.tlog/CL.command.1.tlog
122 | wrapper/Release/wrapper.tlog/CL.read.1.tlog
123 | wrapper/Release/wrapper.tlog/CL.write.1.tlog
124 | wrapper/Release/wrapper.tlog/link.command.1.tlog
125 | wrapper/Release/wrapper.tlog/link.read.1.tlog
126 | wrapper/Release/wrapper.tlog/link.write.1.tlog
127 | wrapper/Release/wrapper.tlog/wrapper.lastbuildstate
128 | wrapper/Release/wrapper.tlog/wrapper.write.1u.tlog
129 | wrapper/wrapper.vcxproj.user
130 | *.db-wal
131 | *.ipch
132 | *.obj
133 | *.idb
134 | *.pdb
135 | *.tlog
136 | *.log
137 | *.recipe
138 | *.txt
139 | *.dll
140 | *.exp
141 | *.ilk
142 | *.lib
143 | *.iobj
144 | *.ipdb
145 |
--------------------------------------------------------------------------------
/CUEORGBPlugin.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.0.32126.317
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CUEORGBPlugin", "CUEORGBPlugin.vcxproj", "{B71258E2-6D34-419A-82C0-E6F822E57902}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenRGBClient", "OpenRGBClient\OpenRGBClient.vcxproj", "{299ADF00-111D-4EEB-B721-A5EE41FF3B72}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "version_wrapper", "version_wrapper\version_wrapper.vcxproj", "{B6B1125B-DED4-4315-AFA8-B0A0481F1D73}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Debug|x86 = Debug|x86
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Debug|x64.ActiveCfg = Debug|x64
21 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Debug|x64.Build.0 = Debug|x64
22 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Debug|x86.ActiveCfg = Debug|Win32
23 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Debug|x86.Build.0 = Debug|Win32
24 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Release|x64.ActiveCfg = Release|x64
25 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Release|x64.Build.0 = Release|x64
26 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Release|x86.ActiveCfg = Release|Win32
27 | {B71258E2-6D34-419A-82C0-E6F822E57902}.Release|x86.Build.0 = Release|Win32
28 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Debug|x64.ActiveCfg = Debug|x64
29 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Debug|x64.Build.0 = Debug|x64
30 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Debug|x86.ActiveCfg = Debug|Win32
31 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Debug|x86.Build.0 = Debug|Win32
32 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Release|x64.ActiveCfg = Release|x64
33 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Release|x64.Build.0 = Release|x64
34 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Release|x86.ActiveCfg = Release|Win32
35 | {299ADF00-111D-4EEB-B721-A5EE41FF3B72}.Release|x86.Build.0 = Release|Win32
36 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Debug|x64.ActiveCfg = Debug|x64
37 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Debug|x64.Build.0 = Debug|x64
38 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Debug|x86.ActiveCfg = Debug|Win32
39 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Debug|x86.Build.0 = Debug|Win32
40 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Release|x64.ActiveCfg = Release|x64
41 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Release|x64.Build.0 = Release|x64
42 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Release|x86.ActiveCfg = Release|Win32
43 | {B6B1125B-DED4-4315-AFA8-B0A0481F1D73}.Release|x86.Build.0 = Release|Win32
44 | EndGlobalSection
45 | GlobalSection(SolutionProperties) = preSolution
46 | HideSolutionNode = FALSE
47 | EndGlobalSection
48 | GlobalSection(ExtensibilityGlobals) = postSolution
49 | SolutionGuid = {9AB9AE6F-EED3-48D5-8324-3BEBBDDE5026}
50 | EndGlobalSection
51 | EndGlobal
52 |
--------------------------------------------------------------------------------
/CUEORGBPlugin.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | 16.0
45 | Win32Proj
46 | {b71258e2-6d34-419a-82c0-e6f822e57902}
47 | CUEORGBPlugin
48 | 10.0
49 |
50 |
51 |
52 | DynamicLibrary
53 | true
54 | v143
55 | Unicode
56 |
57 |
58 | DynamicLibrary
59 | false
60 | v143
61 | true
62 | Unicode
63 |
64 |
65 | DynamicLibrary
66 | true
67 | v143
68 | Unicode
69 |
70 |
71 | DynamicLibrary
72 | false
73 | v143
74 | true
75 | Unicode
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 | true
97 |
98 |
99 | false
100 |
101 |
102 | true
103 |
104 |
105 | false
106 |
107 |
108 |
109 | Level3
110 | true
111 | WIN32;_DEBUG;CUEORGBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS
112 | true
113 | $(ProjectDir)thirdparty;$(ProjectDir)thirdparty\OpenRGB;$(ProjectDir)thirdparty\OpenRGB\RGBController;$(ProjectDir)thirdparty\OpenRGB\net_port;$(ProjectDir)thirdparty\CUESDK;%(AdditionalIncludeDirectories)
114 | MultiThreadedDebug
115 |
116 |
117 | Windows
118 | true
119 | false
120 | exports.def
121 |
122 |
123 |
124 |
125 | Level3
126 | true
127 | true
128 | true
129 | WIN32;NDEBUG;CUEORGBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS
130 | true
131 | $(ProjectDir)thirdparty;$(ProjectDir)thirdparty\OpenRGB;$(ProjectDir)thirdparty\OpenRGB\RGBController;$(ProjectDir)thirdparty\OpenRGB\net_port;$(ProjectDir)thirdparty\CUESDK;%(AdditionalIncludeDirectories)
132 | MultiThreaded
133 |
134 |
135 | Windows
136 | true
137 | true
138 | true
139 | false
140 | exports.def
141 |
142 |
143 |
144 |
145 | Level3
146 | true
147 | WIN32;_DEBUG;CUEORGBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS
148 | true
149 | $(ProjectDir)thirdparty;$(ProjectDir)thirdparty\OpenRGB;$(ProjectDir)thirdparty\OpenRGB\RGBController;$(ProjectDir)thirdparty\OpenRGB\net_port;$(ProjectDir)thirdparty\CUESDK;%(AdditionalIncludeDirectories)
150 | MultiThreadedDebug
151 |
152 |
153 | Windows
154 | true
155 | false
156 | exports.def
157 |
158 |
159 |
160 |
161 | Level3
162 | true
163 | true
164 | true
165 | WIN32;NDEBUG;CUEORGBPLUGIN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_WINSOCK_DEPRECATED_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS
166 | true
167 | $(ProjectDir)thirdparty;$(ProjectDir)thirdparty\OpenRGB;$(ProjectDir)thirdparty\OpenRGB\RGBController;$(ProjectDir)thirdparty\OpenRGB\net_port;$(ProjectDir)thirdparty\CUESDK;%(AdditionalIncludeDirectories)
168 | MultiThreaded
169 |
170 |
171 | Windows
172 | true
173 | true
174 | true
175 | false
176 | exports.def
177 |
178 |
179 |
180 |
181 |
182 |
--------------------------------------------------------------------------------
/CUEORGBPlugin.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 | {28b22ee5-a288-44e4-9de0-64cebbe8261b}
18 |
19 |
20 | {eb880aac-2d97-4e92-8299-786b3caf2dec}
21 |
22 |
23 | {554632bb-f343-4283-abab-df219646a837}
24 |
25 |
26 | {85b595a2-96dd-45aa-9ee8-4e35d4d6b553}
27 |
28 |
29 | {58d07bae-6faa-4a30-bc55-1f652b3facd9}
30 |
31 |
32 | {ad402db8-b4ab-400d-9409-68733bf348ad}
33 |
34 |
35 | {666e7ab7-ad7e-44f9-b510-299bc6b70abe}
36 |
37 |
38 | {eb8bde11-6355-48ee-a47b-437607a44227}
39 |
40 |
41 |
42 |
43 | Source Files
44 |
45 |
46 | Source Files\OpenRGB\net_port
47 |
48 |
49 | Source Files\OpenRGB\RGBController
50 |
51 |
52 | Source Files\OpenRGB\RGBController
53 |
54 |
55 | Source Files\OpenRGB
56 |
57 |
58 | Source Files\OpenRGB
59 |
60 |
61 | Source Files
62 |
63 |
64 | Source Files
65 |
66 |
67 |
68 |
69 | Header Files
70 |
71 |
72 | Header Files\CUESDK
73 |
74 |
75 | Header Files\json
76 |
77 |
78 | Header Files\OpenRGB
79 |
80 |
81 | Header Files\OpenRGB
82 |
83 |
84 | Header Files\OpenRGB\RGBController
85 |
86 |
87 | Header Files\OpenRGB\RGBController
88 |
89 |
90 | Header Files\OpenRGB\net_port
91 |
92 |
93 | Header Files
94 |
95 |
96 | Header Files
97 |
98 |
99 |
--------------------------------------------------------------------------------
/CUESDKDevice.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "CorsairLedIdEnum.h"
4 | #include
5 |
6 | #define ENABLE_BITMASK_OPERATORS(ENUMTYPE) \
7 | constexpr ENUMTYPE operator |(ENUMTYPE lhs, ENUMTYPE rhs) {return static_cast (static_cast::type>(lhs) | static_cast::type>(rhs));} \
8 | constexpr ENUMTYPE operator &(ENUMTYPE lhs, ENUMTYPE rhs) {return static_cast(static_cast::type>(lhs) & static_cast::type>(rhs));} \
9 | constexpr ENUMTYPE operator ^(ENUMTYPE lhs, ENUMTYPE rhs) {return static_cast (static_cast::type>(lhs) ^ static_cast::type>(rhs));} \
10 | constexpr ENUMTYPE operator ~(ENUMTYPE rhs) {return static_cast (~static_cast::type>(rhs));} \
11 | constexpr ENUMTYPE& operator |=(ENUMTYPE& lhs, ENUMTYPE rhs) {lhs = static_cast(static_cast::type>(lhs) | static_cast::type>(rhs));return lhs;} \
12 | constexpr ENUMTYPE& operator &=(ENUMTYPE& lhs, ENUMTYPE rhs) {lhs = static_cast(static_cast::type>(lhs) & static_cast::type>(rhs));return lhs;} \
13 | constexpr ENUMTYPE& operator ^=(ENUMTYPE& lhs, ENUMTYPE rhs) {lhs = static_cast(static_cast::type>(lhs) ^ static_cast::type>(rhs));return lhs;}
14 |
15 | namespace cue
16 | {
17 | namespace dev
18 | {
19 | namespace plugin
20 | {
21 | struct Event;
22 |
23 | enum class ZoneAppearance : std::uint32_t
24 | {
25 | SVG_Path = 0, // This seems to be a list of draw commands for a rectangle: "M 155 111 L 233 111 L 233 166 L 155 166 Z"
26 | UI_Text = 1, // Doesn't seem to work? This should be the flow where it takes a text key and converts to UI text
27 | Literal_Text = 2 // Doesn't seem to work? This should be the flow that takes the text from
28 | };
29 |
30 | enum class SupportedFeatures : std::uint32_t
31 | {
32 | KeyEvents = (1 << 0),
33 | KeyEventsConfiguration = (1 << 1),
34 | DetachedMode = (1 << 2),
35 | PluginProperties = (1 << 3),
36 | DeviceProperties = (1 << 4),
37 | DeviceChannels = (1 << 5)
38 | };
39 | ENABLE_BITMASK_OPERATORS(SupportedFeatures);
40 |
41 | enum SensorType : std::uint32_t
42 | {
43 | Invalid,
44 | Temperature,
45 | FanRpm,
46 | PumpRpm,
47 | Voltage,
48 | Current,
49 | Power
50 | };
51 |
52 | enum class PropertyFlags : std::uint32_t
53 | {
54 | CanRead = (1 << 0),
55 | CanWrite = (1 << 1),
56 | Indexed = (1 << 2)
57 | };
58 | ENABLE_BITMASK_OPERATORS(PropertyFlags);
59 |
60 | enum class PluginPropertyId : std::uint32_t
61 | {
62 | Invalid,
63 | PropertiesList,
64 | Locale
65 | };
66 |
67 | enum class DevicePropertyId : std::int32_t
68 | {
69 | Invalid,
70 | PropertiesList,
71 | ChannelsCount, // Max 2 channels
72 | ChannelName,
73 | SensorsCount,
74 | SensorType,
75 | SensorName,
76 | SensorValue,
77 | FanPerformanceMode,
78 | FanPerformanceModesList,
79 | PerformanceCurveTemplateDefault,
80 | SensorValueMin,
81 | SensorValueMax,
82 | SingleColorZonesList
83 | };
84 |
85 | struct PropertyData
86 | {
87 | union
88 | {
89 | bool* boolArray;
90 | std::int32_t* intArray;
91 | double* doubleArray;
92 | char** strArray;
93 | std::int32_t i32;
94 | std::int64_t s64;
95 | double f64;
96 | char* str;
97 | DevicePropertyId* devicePropertyArray;
98 | PluginPropertyId* pluginPropertyArray;
99 | } data;
100 | std::int32_t count; // 04
101 | };
102 |
103 | enum class FanPerformanceMode : std::uint32_t
104 | {
105 | Invalid,
106 | Default,
107 | Quiet,
108 | Balanced,
109 | Performance,
110 | FixedPwm,
111 | FixedRpm,
112 | Custom,
113 | ZeroRpm
114 | };
115 |
116 | enum class PropertyDataType : std::uint32_t
117 | {
118 | Bool,
119 | Integer,
120 | Double,
121 | String,
122 | BoolArray = 16,
123 | IntegerArray,
124 | DoubleArray,
125 | StringArray,
126 | LedColorArray
127 | };
128 |
129 | enum class Mode : std::uint32_t
130 | {
131 | Invalid,
132 | Detached,
133 | Attached
134 | };
135 |
136 | // 08
137 | struct Image
138 | {
139 | char* path; // 00 00
140 | char* hash; // 04 08 - This is a SHA256 of the image data at the provided path
141 | };
142 |
143 | struct LedColor // contains information about led and its color.
144 | {
145 | CorsairLedId ledId; // identifier of LED to set.
146 | std::int32_t r; // red brightness[0..255].
147 | std::int32_t g; // green brightness[0..255].
148 | std::int32_t b; // blue brightness[0..255].
149 | };
150 |
151 | // 20
152 | struct LedPosition
153 | {
154 | CorsairLedId ledId; // 00
155 | std::int32_t unk04; // 04 - Don't know?
156 | double x; // 08 - Is this supposed to be flipped?
157 | double y; // 10
158 | std::int32_t unk18; // 18 - Don't know?
159 | std::int32_t unk1C; // 1C - Don't know?
160 | };
161 |
162 | // 08
163 | struct LedPositions
164 | {
165 | std::int32_t numberOfLed; // 00 00
166 | LedPosition* ledPosition; // 04 08
167 | };
168 |
169 | // 10
170 | struct LedView
171 | {
172 | CorsairLedId ledId; // 00 00
173 | char* path; // 04 08
174 | ZoneAppearance appearance; // 08 10
175 | char* text; // 0C 18
176 | };
177 |
178 | // 08
179 | struct LedViews
180 | {
181 | std::int32_t numberOfLed; // 00 00
182 | LedView* view; // 04 08
183 | };
184 |
185 | enum class DeviceType : std::uint32_t
186 | {
187 | Invalid = 0,
188 | Keyboard,
189 | Mouse
190 | };
191 |
192 | // 1C
193 | struct DeviceInfo
194 | {
195 | char* deviceName; // 00 00 - UI name of the device
196 | DeviceType deviceType; // 04 04
197 | LedPositions* ledPositions; // 08 08
198 | Image* thumbnail; // 0C 10 - Thumbnail shown when editing a device
199 | char* deviceId; // 10 18 - Unique name of the device, passed to other calls to determine what device it is
200 | std::int32_t numberOfDeviceView; // 14 20 - Number of device views to display in the UI, this will result in multiple calls to CorsairPluginGetDeviceView with a different View index
201 | Image* promoImage; // 18 28 - Image shown in the Devices summary
202 | };
203 |
204 | // 10
205 | struct DeviceView
206 | {
207 | Image* view; // 00 00 - Image shown in the editing view of the device
208 | Image* mask; // 04 08 - Masks the view image, white is opaque, black is transparent
209 | LedViews* ledView; // 08 10
210 | LedViews* actionZones; // 0C 18 - I don't know what this is yet
211 | };
212 | }
213 | }
214 | }
215 |
216 | typedef cue::dev::plugin::DeviceInfo* (*_CorsairPluginGetDeviceInfo)(const char* deviceId);
217 | typedef bool (*_CorsairSetLedsColors)(const char* deviceId, std::int32_t size, cue::dev::plugin::LedColor* ledsColors);
218 | typedef std::int32_t(*_DeviceConnectionStatusChangeCallback)(void* context, const char* deviceName, std::int32_t unk3);
219 | typedef void (*_CorsairSubscribeForDeviceConnectionStatusChanges)(void* context, _DeviceConnectionStatusChangeCallback callback);
220 | typedef void (*_CorsairPluginUnsubscribeFromDeviceStatusChanges)();
221 | typedef cue::dev::plugin::DeviceView* (*_CorsairPluginGetDeviceView)(const char* deviceId, std::int32_t index);
222 | typedef void (*_CorsairPluginFreeDeviceInfo)(cue::dev::plugin::DeviceInfo* memory);
223 | typedef void (*_CorsairPluginFreeDeviceView)(cue::dev::plugin::DeviceView* memory);
224 | typedef bool (*_CorsairConfigureKeyEvent)(void* unk1, std::int32_t unk2);
225 | typedef void (*CorsairEventHandler)(void* context, const cue::dev::plugin::Event* event);
226 | typedef bool (*_CorsairSubscribeForEvents)(CorsairEventHandler onEvent, void* context);
227 | typedef bool (*_CorsairUnsubscribeFromEvents)();
228 | typedef void (*_CorsairSetMode)(std::int32_t mode);
229 |
230 | // 2C
231 | struct CorsairGetInstance_v66
232 | {
233 | _CorsairPluginGetDeviceInfo getDeviceInfo; // 00 00
234 | _CorsairSetLedsColors setLedsColors; // 04 08
235 | _CorsairSubscribeForDeviceConnectionStatusChanges subscribeForDeviceConnectionStatusChanges; // 08 10
236 | _CorsairPluginUnsubscribeFromDeviceStatusChanges unsubscribeFromDeviceConnectionStatusChanges; // 0C 18
237 | _CorsairPluginGetDeviceView getDeviceView; // 10 20
238 | _CorsairPluginFreeDeviceInfo freeDeviceInfo; // 14 28
239 | _CorsairPluginFreeDeviceView freeDeviceView; // 18 30
240 | _CorsairConfigureKeyEvent configureKeyEvent; // 1C 38
241 | _CorsairSubscribeForEvents subscribeForEvents; // 20 40
242 | _CorsairUnsubscribeFromEvents unsubscribeFromEvents; // 24 48
243 | _CorsairSetMode setMode; // 28 50
244 | };
245 |
246 | typedef bool (*_CorsairGetPluginPropertyInfo)(cue::dev::plugin::PluginPropertyId propertyId, std::int32_t index, cue::dev::plugin::PropertyDataType& dataType, cue::dev::plugin::PropertyFlags& flags);
247 | typedef cue::dev::plugin::PropertyData* (*_CorsairReadPluginPropertyData)(cue::dev::plugin::PluginPropertyId propertyId, std::int32_t index);
248 | typedef bool (*_CorsairWritePluginPropertyData)(cue::dev::plugin::PluginPropertyId propertyId, std::int32_t index, cue::dev::plugin::PropertyData&);
249 |
250 | typedef bool (*_CorsairGetDevicePropertyInfo)(const char* deviceId, cue::dev::plugin::DevicePropertyId propertyId, std::int32_t index, cue::dev::plugin::PropertyDataType& dataType, cue::dev::plugin::PropertyFlags& flags);
251 | typedef cue::dev::plugin::PropertyData* (*_CorsairReadDevicePropertyData)(const char* deviceId, cue::dev::plugin::DevicePropertyId propertyId, std::int32_t index);
252 | typedef bool (*_CorsairWriteDevicePropertyData)(const char* deviceId, cue::dev::plugin::DevicePropertyId propertyId, std::int32_t index, cue::dev::plugin::PropertyData&);
253 |
254 | typedef void (*_CorsairFreePropertyData)(cue::dev::plugin::PropertyDataType dataType, cue::dev::plugin::PropertyData* data);
255 |
256 | struct LedColorChannel
257 | {
258 | void* unk00;
259 | cue::dev::plugin::LedColor* ledColors;
260 | };
261 | typedef void (*_CorsairSetLedColorAtChannel)(const char* deviceId, std::int32_t unk1, std::int32_t size, LedColorChannel& channel);
262 |
263 | // 4C
264 | struct CorsairGetInstance_v67
265 | {
266 | _CorsairPluginGetDeviceInfo getDeviceInfo; // 00 00
267 | _CorsairSetLedsColors setLedsColors; // 04 08
268 | _CorsairSubscribeForDeviceConnectionStatusChanges subscribeForDeviceConnectionStatusChanges; // 08 10
269 | _CorsairPluginUnsubscribeFromDeviceStatusChanges unsubscribeFromDeviceConnectionStatusChanges; // 0C 18
270 | _CorsairPluginGetDeviceView getDeviceView; // 10 20
271 | _CorsairPluginFreeDeviceInfo freeDeviceInfo; // 14 28
272 | _CorsairPluginFreeDeviceView freeDeviceView; // 18 30
273 | _CorsairConfigureKeyEvent configureKeyEvent; // 1C 38
274 | _CorsairSubscribeForEvents subscribeForEvents; // 20 40
275 | _CorsairUnsubscribeFromEvents unsubscribeFromEvents; // 24 48
276 | _CorsairSetMode setMode; // 28 50
277 | _CorsairGetPluginPropertyInfo getPropertyInfo; // 2C 58
278 | _CorsairReadPluginPropertyData readPropertyData; // 30 60
279 | _CorsairWritePluginPropertyData writePropertyData; // 34 68
280 | _CorsairGetDevicePropertyInfo getDevicePropertyInfo; // 38 70
281 | _CorsairReadDevicePropertyData readDevicePropertyData; // 3C 78
282 | _CorsairWriteDevicePropertyData writeDevicePropertyData; // 40 80
283 | _CorsairFreePropertyData freePropertyData; // 44 88
284 | _CorsairSetLedColorAtChannel setLedsColorsAtChannel; // 48 90
285 | };
286 |
--------------------------------------------------------------------------------
/CorsairPluginDevice.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include