From 52e5f2aad3bbdfcfe572e45da2186569a02f64f5 Mon Sep 17 00:00:00 2001 From: HunterZ <> Date: Mon, 29 Oct 2018 21:38:54 -0700 Subject: [PATCH 1/3] Initial Razer Chroma support --- UniLight/LFXUtil.h | 2 - UniLight/Main.cpp | 11 + UniLight/RZCUtil.cpp | 222 ++++++++ UniLight/RZCUtil.h | 20 + UniLight/UniLight.vcxproj | 4 +- UniLight/razer/ChromaAppInfo.xml | 7 + UniLight/razer/RzChromaSDKDefines.h | 172 ++++++ UniLight/razer/RzChromaSDKTypes.h | 813 ++++++++++++++++++++++++++++ UniLight/razer/RzErrors.h | 46 ++ 9 files changed, 1294 insertions(+), 3 deletions(-) create mode 100644 UniLight/RZCUtil.cpp create mode 100644 UniLight/RZCUtil.h create mode 100644 UniLight/razer/ChromaAppInfo.xml create mode 100644 UniLight/razer/RzChromaSDKDefines.h create mode 100644 UniLight/razer/RzChromaSDKTypes.h create mode 100644 UniLight/razer/RzErrors.h diff --git a/UniLight/LFXUtil.h b/UniLight/LFXUtil.h index e68c76f..536ddeb 100644 --- a/UniLight/LFXUtil.h +++ b/UniLight/LFXUtil.h @@ -16,8 +16,6 @@ namespace LFXUtil virtual ~LFXUtilC(); - // set LFX color to given RGB value - // returns true on success, false on failure ResultT SetLFXColor(unsigned char red, unsigned char green, unsigned char blue); }; } diff --git a/UniLight/Main.cpp b/UniLight/Main.cpp index 5b7f9c5..1bd2ac2 100644 --- a/UniLight/Main.cpp +++ b/UniLight/Main.cpp @@ -19,6 +19,7 @@ typedef struct _iobuf FILE; #include "CUEUtil.h" #include "LFXUtil.h" #include "LLEDUtil.h" +#include "RZCUtil.h" #include "resource.h" #include "UniLight.h" @@ -50,16 +51,19 @@ namespace CUEUtil::CUEUtilC cueUtil; LFXUtil::LFXUtilC lfxUtil; LLEDUtil::LLEDUtilC llledUtil; + RZCUtil::RZCUtilC rzcUtil; COLORREF lastColor(0); ResultT cueStatus(false, _T("Not yet initialized")); ResultT lfxStatus(false, _T("Not yet initialized")); ResultT lledStatus(false, _T("Not yet initialized")); + ResultT rzcStatus(false, _T("Not yet initialized")); const std::wstring sSuccess(_T("SUCCESS")); const std::wstring sFailure(_T("FAILURE")); const std::wstring sIndent2(_T("\n\t\t")); const std::wstring sCUEStatus(_T("\n\n\tCorsair CUE:")); const std::wstring sLFXStatus(_T("\n\n\tDell/Alienware AlienFX/LightFX:")); const std::wstring sLLEDStatus(_T("\n\n\tLogitech LED:")); + const std::wstring sRZCStatus(_T("\n\n\tRazer Chroma:")); const wchar_t cSuccess(0x2714); // check mark const wchar_t cFailure(0x2716); // cross mark } @@ -108,6 +112,9 @@ void ShowStatus(HWND hwnd) status += sLLEDStatus + sIndent2 + (lledStatus.first ? sSuccess : sFailure) + sIndent2 + lledStatus.second; + status += sRZCStatus + + sIndent2 + (rzcStatus.first ? sSuccess : sFailure) + + sIndent2 + rzcStatus.second; MessageBox(hwnd, status.c_str(), _T("UniLight detailed status"), NULL); } @@ -126,6 +133,9 @@ void UpdateColor(const COLORREF curColor) // set Logitech LED color lledStatus = llledUtil.SetLLEDColor(red, green, blue); + // set Razer Chroma color + rzcStatus = rzcUtil.SetRZCColor(red, green, blue); + // set tooltip std::wstringstream s; s << "UniLight status:"; @@ -134,6 +144,7 @@ void UpdateColor(const COLORREF curColor) s << "\nCorsCUE: " << (cueStatus.first ? cSuccess : cFailure); s << "\nLightFX: " << (lfxStatus.first ? cSuccess : cFailure); s << "\nLogiLED: " << (lledStatus.first ? cSuccess : cFailure); + s << "\nRzrChrm: " << (rzcStatus.first ? cSuccess : cFailure); StringCchCopy(notifyIconData.szTip, sizeof(notifyIconData.szTip), s.str().c_str()); Shell_NotifyIcon(NIM_MODIFY, ¬ifyIconData); diff --git a/UniLight/RZCUtil.cpp b/UniLight/RZCUtil.cpp new file mode 100644 index 0000000..b1bbdb9 --- /dev/null +++ b/UniLight/RZCUtil.cpp @@ -0,0 +1,222 @@ +// UniLight by HunterZ + +#include "RZCUtil.h" + +#include +#include +#include // COLORREF, HMODULE +#include "razer/RzChromaSDKDefines.h" +#include "razer/RzChromaSDKTypes.h" +#include "razer/RzErrors.h" + +//#ifdef _WIN64 +//#define CHROMASDKDLL _T("RzChromaSDK64.dll") +//#else +#define CHROMASDKDLL _T("RzChromaSDK.dll") +//#endif + +namespace +{ + typedef std::vector EffectListT; + + typedef RZRESULT(*INIT)(void); + typedef RZRESULT(*UNINIT)(void); + typedef RZRESULT(*CREATEEFFECT)(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATEKEYBOARDEFFECT)(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATEHEADSETEFFECT)(ChromaSDK::Headset::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATEMOUSEPADEFFECT)(ChromaSDK::Mousepad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATEMOUSEEFFECT)(ChromaSDK::Mouse::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATEKEYPADEFFECT)(ChromaSDK::Keypad::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*CREATECHROMALINKEFFECT)(ChromaSDK::ChromaLink::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID *pEffectId); + typedef RZRESULT(*SETEFFECT)(RZEFFECTID EffectId); + typedef RZRESULT(*DELETEEFFECT)(RZEFFECTID EffectId); + typedef RZRESULT(*REGISTEREVENTNOTIFICATION)(HWND hWnd); + typedef RZRESULT(*UNREGISTEREVENTNOTIFICATION)(void); + typedef RZRESULT(*QUERYDEVICE)(RZDEVICEID DeviceId, ChromaSDK::DEVICE_INFO_TYPE &DeviceInfo); + + INIT Init(NULL); + UNINIT UnInit(NULL); + CREATEEFFECT CreateEffect(NULL); + CREATEKEYBOARDEFFECT CreateKeyboardEffect(NULL); + CREATEMOUSEEFFECT CreateMouseEffect(NULL); + CREATEHEADSETEFFECT CreateHeadsetEffect(NULL); + CREATEMOUSEPADEFFECT CreateMousepadEffect(NULL); + CREATEKEYPADEFFECT CreateKeypadEffect(NULL); + CREATECHROMALINKEFFECT CreateChromaLinkEffect(NULL); + SETEFFECT SetEffect(NULL); + DELETEEFFECT DeleteEffect(NULL); + QUERYDEVICE QueryDevice(NULL); + + bool RZC_INITIALIZED(false); + HMODULE DLL_HANDLE(NULL); + EffectListT ACTIVE_EFFECT_LIST; + + ResultT InitRZC() + { + if (RZC_INITIALIZED) + return ResultT(true, _T("Already initialized")); + + // Razer is stupid and forces us to manually load the DLL and bind its functions + DLL_HANDLE = ::LoadLibrary(CHROMASDKDLL); + if (DLL_HANDLE == NULL) + return ResultT(false, _T("LoadLibrary() failed")); + + INIT Init((INIT)::GetProcAddress(DLL_HANDLE, "Init")); + if (Init == NULL) + return ResultT(false, _T("Failed to find Init() in DLL")); + + if (Init() != RZRESULT_SUCCESS) + return ResultT(false, _T("DLL Init() failed")); + + CreateEffect = (CREATEEFFECT)::GetProcAddress(DLL_HANDLE, "CreateEffect"); + CreateKeyboardEffect = (CREATEKEYBOARDEFFECT)::GetProcAddress(DLL_HANDLE, "CreateKeyboardEffect"); + CreateMouseEffect = (CREATEMOUSEEFFECT)::GetProcAddress(DLL_HANDLE, "CreateMouseEffect"); + CreateMousepadEffect = (CREATEMOUSEPADEFFECT)::GetProcAddress(DLL_HANDLE, "CreateMousepadEffect"); + CreateKeypadEffect = (CREATEKEYPADEFFECT)::GetProcAddress(DLL_HANDLE, "CreateKeypadEffect"); + CreateHeadsetEffect = (CREATEHEADSETEFFECT)::GetProcAddress(DLL_HANDLE, "CreateHeadsetEffect"); + CreateChromaLinkEffect = (CREATECHROMALINKEFFECT)::GetProcAddress(DLL_HANDLE, "CreateChromaLinkEffect"); + SetEffect = (SETEFFECT)GetProcAddress(DLL_HANDLE, "SetEffect"); + DeleteEffect = (DELETEEFFECT)GetProcAddress(DLL_HANDLE, "DeleteEffect"); + if (CreateEffect == NULL) + return ResultT(false, _T("Failed to find CreateEffect() in DLL")); + if (CreateKeyboardEffect == NULL) + return ResultT(false, _T("Failed to find CreateKeyboardEffect() in DLL")); + if (CreateMouseEffect == NULL) + return ResultT(false, _T("Failed to find CreateMouseEffect() in DLL")); + if (CreateMousepadEffect == NULL) + return ResultT(false, _T("Failed to find CreateMousematEffect() in DLL")); + if (CreateKeypadEffect == NULL) + return ResultT(false, _T("Failed to find CreateKeypadEffect() in DLL")); + if (CreateHeadsetEffect == NULL) + return ResultT(false, _T("Failed to find CreateHeadsetEffect() in DLL")); + if (CreateChromaLinkEffect == NULL) + return ResultT(false, _T("Failed to find CreateChromaLinkEffect() in DLL")); + if (SetEffect == NULL) + return ResultT(false, _T("Failed to find SetEffect() in DLL")); + if (DeleteEffect == NULL) + return ResultT(false, _T("Failed to find DeleteEffect() in DLL")); + + RZC_INITIALIZED = true; + return ResultT(true, _T("InitRZC() success")); + } + + void DeleteEffects() + { + if (RZC_INITIALIZED) + { + for (EffectListT::iterator i(ACTIVE_EFFECT_LIST.begin()); + i != ACTIVE_EFFECT_LIST.end(); + ++i) + { + DeleteEffect(*i); + } + } + ACTIVE_EFFECT_LIST.clear(); + } +} + +namespace RZCUtil +{ + RZCUtilC::~RZCUtilC() + { + if (!ACTIVE_EFFECT_LIST.empty()) + DeleteEffects(); + + if (!RZC_INITIALIZED) return; + + UNINIT UnInit = (UNINIT)::GetProcAddress(DLL_HANDLE, "UnInit"); + if (UnInit != NULL) + UnInit(); + + ::FreeLibrary(DLL_HANDLE); + DLL_HANDLE = NULL; + + RZC_INITIALIZED = false; + } + + ResultT RZCUtilC::SetRZCColor(unsigned char red, unsigned char green, unsigned char blue) + { + if (!RZC_INITIALIZED) + { + // perform lazy initialization + // abort if initialization fails + const ResultT& result(InitRZC()); + if (!result.first) + return result; + } + + // clean up previously-activated effects + if (!ACTIVE_EFFECT_LIST.empty()) + DeleteEffects(); + + const COLORREF colorRef(RGB(red, green, blue)); + + // Razer requires calling a separate effect creation function per device + // type because reasons + // Valid effect(s) will be gathered into a vector for subsequent activation + EffectListT effectList; + RZEFFECTID effectId; + // ChromaLink + { + ChromaSDK::ChromaLink::STATIC_EFFECT_TYPE chromaLinkParam = { colorRef }; + if (CreateChromaLinkEffect(ChromaSDK::ChromaLink::CHROMA_STATIC, &chromaLinkParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + // Headset + { + ChromaSDK::Headset::STATIC_EFFECT_TYPE headsetParam = { colorRef }; + if (CreateHeadsetEffect(ChromaSDK::Headset::CHROMA_STATIC, &headsetParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + // Keyboard + { + ChromaSDK::Keyboard::STATIC_EFFECT_TYPE keyboardParam = { colorRef }; + if (CreateKeyboardEffect(ChromaSDK::Keyboard::CHROMA_STATIC, &keyboardParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + // Keypad + { + ChromaSDK::Keypad::STATIC_EFFECT_TYPE keypadParam = { colorRef }; + if (CreateKeypadEffect(ChromaSDK::Keypad::CHROMA_STATIC, &keypadParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + // Mouse + { + ChromaSDK::Mouse::STATIC_EFFECT_TYPE mouseParam = { ChromaSDK::Mouse::RZLED_ALL, colorRef }; + if (CreateMouseEffect(ChromaSDK::Mouse::CHROMA_STATIC, &mouseParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + // Mousepad + { + ChromaSDK::Mousepad::STATIC_EFFECT_TYPE mousepadParam = { colorRef }; + if (CreateMousepadEffect(ChromaSDK::Mousepad::CHROMA_STATIC, &mousepadParam, &effectId) == RZRESULT_SUCCESS) + effectList.push_back(effectId); + } + + // abort if nothing was created (no devices connected?) + if (effectList.empty()) + return ResultT(false, _T("SetRZColor() failed to create any effects")); + + // activate effects + std::size_t successCount(0); + for (EffectListT::iterator i(effectList.begin()); + i != effectList.end(); + ++i) + { + if (SetEffect(*i) == RZRESULT_SUCCESS) + ++successCount; + } + + // store effects regardless of whether they activated, as we still need to + // clean them up later + ACTIVE_EFFECT_LIST.swap(effectList); + + if (!successCount) + return ResultT(false, _T("SetRZCColor() failed to activate any effects")); + + if (successCount < ACTIVE_EFFECT_LIST.size()) + return ResultT(true, _T("SetRZCColor() partial success")); + + return ResultT(true, _T("SetRZCColor() success")); + } +} diff --git a/UniLight/RZCUtil.h b/UniLight/RZCUtil.h new file mode 100644 index 0000000..c0477a4 --- /dev/null +++ b/UniLight/RZCUtil.h @@ -0,0 +1,20 @@ +// UniLight by HunterZ + +#pragma once + +#include "UniLight.h" // ResultT + +// utilities for working with Razer Chroma API +namespace RZCUtil +{ + // class for working with Razer Chroma API + // no constructor because lazy initialization is used + class RZCUtilC + { + public: + + virtual ~RZCUtilC(); + + ResultT SetRZCColor(unsigned char red, unsigned char green, unsigned char blue); + }; +} diff --git a/UniLight/UniLight.vcxproj b/UniLight/UniLight.vcxproj index 38ce84d..d2895cd 100644 --- a/UniLight/UniLight.vcxproj +++ b/UniLight/UniLight.vcxproj @@ -24,6 +24,7 @@ + @@ -31,6 +32,7 @@ + @@ -170,4 +172,4 @@ - \ No newline at end of file + diff --git a/UniLight/razer/ChromaAppInfo.xml b/UniLight/razer/ChromaAppInfo.xml new file mode 100644 index 0000000..36d8b56 --- /dev/null +++ b/UniLight/razer/ChromaAppInfo.xml @@ -0,0 +1,7 @@ + + + UniLight + Synchronizes RGB LED devices with Windows accent/colorization color + + + diff --git a/UniLight/razer/RzChromaSDKDefines.h b/UniLight/razer/RzChromaSDKDefines.h new file mode 100644 index 0000000..b95af1b --- /dev/null +++ b/UniLight/razer/RzChromaSDKDefines.h @@ -0,0 +1,172 @@ +//! \file RzChromaSDKDefines.h +//! \brief Definitions of global and static variables. + +#ifndef _RZSCHROMADKDEFINES_H_ +#define _RZSCHROMADKDEFINES_H_ + +#pragma once + +#ifndef GUID_DEFINED +#include +#endif + +namespace ChromaSDK +{ + // Keyboards + //! Razer Blackwidow Chroma device. + // {2EA1BB63-CA28-428D-9F06-196B88330BBB} + static const GUID BLACKWIDOW_CHROMA = + { 0x2ea1bb63, 0xca28, 0x428d, { 0x9f, 0x06, 0x19, 0x6b, 0x88, 0x33, 0x0b, 0xbb } }; + + //! Razer Blackwidow Chroma Tournament Edition device. + // {ED1C1B82-BFBE-418F-B49D-D03F05B149DF} + static const GUID BLACKWIDOW_CHROMA_TE = + { 0xed1c1b82, 0xbfbe, 0x418f, { 0xb4, 0x9d, 0xd0, 0x3f, 0x5, 0xb1, 0x49, 0xdf } }; + + //! Razer Deathstalker device. + // {18C5AD9B-4326-4828-92C4-2669A66D2283} + static const GUID DEATHSTALKER_CHROMA = + { 0x18c5ad9b, 0x4326, 0x4828, { 0x92, 0xc4, 0x26, 0x69, 0xa6, 0x6d, 0x22, 0x83 } }; + + //! Overwatch Keyboard. + // {872AB2A9-7959-4478-9FED-15F6186E72E4} + static const GUID OVERWATCH_KEYBOARD = + { 0x872ab2a9, 0x7959, 0x4478, { 0x9f, 0xed, 0x15, 0xf6, 0x18, 0x6e, 0x72, 0xe4 } }; + + //! Razer Blackwidow X Chroma device. + // {5AF60076-ADE9-43D4-B574-52599293B554} + static const GUID BLACKWIDOW_X_CHROMA = + { 0x5af60076, 0xade9, 0x43d4, { 0xb5, 0x74, 0x52, 0x59, 0x92, 0x93, 0xb5, 0x54 } }; + + //! Razer Blackwidow X TE Chroma device. + // {2D84DD51-3290-4AAC-9A89-D8AFDE38B57C} + static const GUID BLACKWIDOW_X_TE_CHROMA = + { 0x2d84dd51, 0x3290, 0x4aac, { 0x9a, 0x89, 0xd8, 0xaf, 0xde, 0x38, 0xb5, 0x7c } }; + + //! Razer Omata Chroma + // {803378C1-CC48-4970-8539-D828CC1D420A} + static const GUID OMATA_CHROMA = + { 0x803378c1, 0xcc48, 0x4970,{ 0x85, 0x39, 0xd8, 0x28, 0xcc, 0x1d, 0x42, 0xa } }; + + //! Razer Blade Stealth. + // {C83BDFE8-E7FC-40E0-99DB-872E23F19891} + static const GUID BLADE_STEALTH = + { 0xc83bdfe8, 0xe7fc, 0x40e0, { 0x99, 0xdb, 0x87, 0x2e, 0x23, 0xf1, 0x98, 0x91 } }; + + //! Razer Blade + // {F2BEDFAF-A0FE-4651-9D41-B6CE603A3DDD} + static const GUID BLADE = + { 0xf2bedfaf, 0xa0fe, 0x4651, { 0x9d, 0x41, 0xb6, 0xce, 0x60, 0x3a, 0x3d, 0xdd } }; + + //! Razer Blade Pro + // {A73AC338-F0E5-4BF7-91AE-DD1F7E1737A5} + static const GUID BLADE_PRO = + { 0xa73ac338, 0xf0e5, 0x4bf7,{ 0x91, 0xae, 0xdd, 0x1f, 0x7e, 0x17, 0x37, 0xa5 } }; + + //! Razer Blackwidow Chroma v2 + // {608E743F-B402-44BD-A7A6-7AA9F574ECF4} + static const GUID BLACKWIDOW_CHROMA2 = + { 0x608e743f, 0xb402, 0x44bd,{ 0xa7, 0xa6, 0x7a, 0xa9, 0xf5, 0x74, 0xec, 0xf4 } }; + + + + // Mice + //! Razer Deathadder Chroma device. + // {AEC50D91-B1F1-452F-8E16-7B73F376FDF3} + static const GUID DEATHADDER_CHROMA = + { 0xaec50d91, 0xb1f1, 0x452f, { 0x8e, 0x16, 0x7b, 0x73, 0xf3, 0x76, 0xfd, 0xf3 } }; + + //! Razer Mamba Chroma Tournament Edition device. + // {7EC00450-E0EE-4289-89D5-0D879C19061A} + static const GUID MAMBA_CHROMA_TE = + { 0x7ec00450, 0xe0ee, 0x4289, { 0x89, 0xd5, 0xd, 0x87, 0x9c, 0x19, 0x6, 0x1a } }; + + //! Razer Diamondback device. + // {FF8A5929-4512-4257-8D59-C647BF9935D0} + static const GUID DIAMONDBACK_CHROMA = + { 0xff8a5929, 0x4512, 0x4257, { 0x8d, 0x59, 0xc6, 0x47, 0xbf, 0x99, 0x35, 0xd0 } }; + + //! Razer Mamba device. + // {D527CBDC-EB0A-483A-9E89-66D50463EC6C} + static const GUID MAMBA_CHROMA = + { 0xd527cbdc, 0xeb0a, 0x483a, { 0x9e, 0x89, 0x66, 0xd5, 0x4, 0x63, 0xec, 0x6c } }; + + //! Razer Naga Epic device. + // {D714C50B-7158-4368-B99C-601ACB985E98} + static const GUID NAGA_EPIC_CHROMA = + { 0xd714c50b, 0x7158, 0x4368, { 0xb9, 0x9c, 0x60, 0x1a, 0xcb, 0x98, 0x5e, 0x98 } }; + + //! Razer Naga device. + // {F1876328-6CA4-46AE-BE04-BE812B414433} + static const GUID NAGA_CHROMA = + { 0xf1876328, 0x6ca4, 0x46ae, { 0xbe, 0x4, 0xbe, 0x81, 0x2b, 0x41, 0x44, 0x33 } }; + + //! Razer Orochi Chroma device. + // {52C15681-4ECE-4DD9-8A52-A1418459EB34} + static const GUID OROCHI_CHROMA = + { 0x52c15681, 0x4ece, 0x4dd9, { 0x8a, 0x52, 0xa1, 0x41, 0x84, 0x59, 0xeb, 0x34 } }; + + //! Razer Naga Hex Chroma device. + // {195D70F5-F285-4CFF-99F2-B8C0E9658DB4} + static const GUID NAGA_HEX_CHROMA = + { 0x195d70f5, 0xf285, 0x4cff, { 0x99, 0xf2, 0xb8, 0xc0, 0xe9, 0x65, 0x8d, 0xb4 } }; + + //! Razer DeathAdder Elite Chroma device. + // {77834867-3237-4A9F-AD77-4A46C4183003} + static const GUID DEATHADDER_ELITE_CHROMA = + { 0x77834867, 0x3237, 0x4a9f,{ 0xad, 0x77, 0x4a, 0x46, 0xc4, 0x18, 0x30, 0x3 } }; + + + // Headsets + //! Razer Kraken 7.1 Chroma device. + // {CD1E09A5-D5E6-4A6C-A93B-E6D9BF1D2092} + static const GUID KRAKEN71_CHROMA = + { 0xcd1e09a5, 0xd5e6, 0x4a6c, { 0xa9, 0x3b, 0xe6, 0xd9, 0xbf, 0x1d, 0x20, 0x92 } }; + + //! Razer ManO'War device. + // {DF3164D7-5408-4A0E-8A7F-A7412F26BEBF} + static const GUID MANOWAR_CHROMA = + { 0xdf3164d7, 0x5408, 0x4a0e, { 0x8a, 0x7f, 0xa7, 0x41, 0x2f, 0x26, 0xbe, 0xbf } }; + + //! Razer Kraken 7.1 Chroma Refresh headset. + // {7FB8A36E-9E74-4BB3-8C86-CAC7F7891EBD} + static const GUID KRAKEN71_REFRESH_CHROMA = + { 0x7fb8a36e, 0x9e74, 0x4bb3,{ 0x8c, 0x86, 0xca, 0xc7, 0xf7, 0x89, 0x1e, 0xbd } }; + + + // Mouse mat + //! Razer Firefly device. + // {80F95A94-73D2-48CA-AE9A-0986789A9AF2} + static const GUID FIREFLY_CHROMA = + { 0x80f95a94, 0x73d2, 0x48ca, { 0xae, 0x9a, 0x9, 0x86, 0x78, 0x9a, 0x9a, 0xf2 } }; + + + // Keypads + //! Razer Tartarus device. + // {00F0545C-E180-4AD1-8E8A-419061CE505E} + static const GUID TARTARUS_CHROMA = + { 0xf0545c, 0xe180, 0x4ad1, { 0x8e, 0x8a, 0x41, 0x90, 0x61, 0xce, 0x50, 0x5e } }; + + //! Razer Orbweaver device. + // {9D24B0AB-0162-466C-9640-7A924AA4D9FD} + static const GUID ORBWEAVER_CHROMA = + { 0x9d24b0ab, 0x162, 0x466c, { 0x96, 0x40, 0x7a, 0x92, 0x4a, 0xa4, 0xd9, 0xfd } }; + + + // Chroma Linked devices + // {35F6F18D-1AE5-436C-A575-AB44A127903A} + static const GUID LENOVO_Y900 = + { 0x35f6f18d, 0x1ae5, 0x436c, { 0xa5, 0x75, 0xab, 0x44, 0xa1, 0x27, 0x90, 0x3a } }; + + // {47DB1FA7-6B9B-4EE6-B6F4-4071A3B2053B} + static const GUID LENOVO_Y27 = + { 0x47db1fa7, 0x6b9b, 0x4ee6, { 0xb6, 0xf4, 0x40, 0x71, 0xa3, 0xb2, 0x5, 0x3b } }; + + // {0201203B-62F3-4C50-83DD-598BABD208E0} + static const GUID CORE_CHROMA = + { 0x201203b, 0x62f3, 0x4c50, { 0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0 } }; + + +} + +#endif diff --git a/UniLight/razer/RzChromaSDKTypes.h b/UniLight/razer/RzChromaSDKTypes.h new file mode 100644 index 0000000..f0ec969 --- /dev/null +++ b/UniLight/razer/RzChromaSDKTypes.h @@ -0,0 +1,813 @@ +//! \file RzChromaSDKTypes.h +//! \brief Data types. + +#ifndef _RZCHROMASDKTYPES_H_ +#define _RZCHROMASDKTYPES_H_ + +#pragma once + +typedef LONG RZRESULT; //!< Return result. +typedef GUID RZEFFECTID; //!< Effect Id. +typedef GUID RZDEVICEID; //!< Device Id. +typedef unsigned int RZDURATION; //!< Milliseconds. +typedef size_t RZSIZE; //!< Size. +typedef void* PRZPARAM; //!< Context sensitive pointer. +typedef DWORD RZID; //!< Generic data type for Identifier. +typedef DWORD RZCOLOR; //!< Color data. 1st byte = Red; 2nd byte = Green; 3rd byte = Blue; 4th byte = Alpha (if applicable) + +namespace ChromaSDK +{ + //! Event notification Window message + const UINT WM_CHROMA_EVENT = WM_APP+0x2000; + + //! Chroma generic effects. Note: Not all devices supported the listed effects. + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_WAVE, //!< Wave effect (This effect type has deprecated and should not be used). + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect type has deprecated and should not be used). + CHROMA_BREATHING, //!< Breathing effect (This effect type has deprecated and should not be used). + CHROMA_BLINKING, //!< Blinking effect (This effect type has deprecated and should not be used). + CHROMA_REACTIVE, //!< Reactive effect (This effect type has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_CUSTOM, //!< Custom effect. For mice, please see Mouse::CHROMA_CUSTOM2. + CHROMA_RESERVED, //!< Reserved + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + //! Device info. + typedef struct DEVICE_INFO_TYPE + { + //! Device types. + enum DeviceType + { + DEVICE_KEYBOARD = 1, //!< Keyboard device. + DEVICE_MOUSE = 2, //!< Mouse device. + DEVICE_HEADSET = 3, //!< Headset device. + DEVICE_MOUSEPAD = 4, //!< Mousepad device. + DEVICE_KEYPAD = 5, //!< Keypad device. + DEVICE_SYSTEM = 6, //!< System device. + DEVICE_INVALID //!< Invalid device. + } DeviceType; + + DWORD Connected; //!< Number of devices connected. + } DEVICE_INFO_TYPE; + + const RZSIZE MAX_ROW = 30; //!< Maximum rows for custom effects. + const RZSIZE MAX_COLUMN = 30; //!< Maximum columns for custom effects. + + //! Blinking effect (This effect type has deprecated and should not be used). + typedef struct BLINKING_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(BLINKING_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + COLORREF Color; //!< Blinking color + } BLINKING_EFFECT_TYPE; + + //! Breathing effect (This effect type has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + RZSIZE Size; //!< Size of ths structure. Size = sizeof(BREATHING_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + //! Breathing effect types. + enum _Type + { + ONE_COLOR = 1, //!< 1 color (Only fill Color1). + TWO_COLORS, //!< 2 colors. + RANDOM_COLORS //!< Random colors + } Type; + + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect (This effect type has deprecated and should not be used). + typedef struct CUSTOM_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(CUSTOM_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + RZCOLOR Color[MAX_ROW][MAX_COLUMN]; + } CUSTOM_EFFECT_TYPE; + + //! No effect. + typedef struct NO_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(NO_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + } NO_EFFECT_TYPE; + + //! Reactive effect (This effect type has deprecated and should not be used). + typedef struct REACTIVE_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(REACTIVE_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + //! Duration of the effect. + enum _Duration + { + DURATION_SHORT = 1, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG //!< Long duration. + } Duration; //!< The time taken for the effect to fade away. + + COLORREF Color; //!< Color of the effect. + } REACTIVE_EFFECT_TYPE; + + //! Spectrum cycling effect (This effect type has deprecated and should not be used). + typedef struct SPECTRUMCYCLING_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + } SPECTRUMCYCLING_EFFECT_TYPE; + + //! Starlight effect (This effect type has deprecated and should not be used). + typedef struct STARLIGHT_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(SPECTRUMCYCLING_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + //! Starlight effect types. + enum _Type + { + TWO_COLORS = 1, //!< 2 colors. + RANDOM_COLORS //!< Random colors + } Type; + + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + + //! Duration of the effect. + enum _Duration + { + DURATION_SHORT = 1, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG //!< Long duration. + } Duration; //!< The time taken for the effect to fade away. + + } STARLIGHT_EFFECT_TYPE; + + //! Static effect (This effect type has deprecated and should not be used). + typedef struct STATIC_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(STATIC_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + COLORREF Color; //!< Color of the effect. + } STATIC_EFFECT_TYPE; + + //! Wave effect (This effect type has deprecated and should not be used). + typedef struct WAVE_EFFECT_TYPE + { + RZSIZE Size; //!< Size of the structure. Size = sizeof(WAVE_EFFECT_TYPE) + DWORD Param; //!< Extra parameters. + + //! Direction of effect. + enum _Direction + { + DIRECTION_LEFT_TO_RIGHT = 1, //!< Left to right. + DIRECTION_RIGHT_TO_LEFT, //!< Right to left. + DIRECTION_FRONT_TO_BACK, //!< Front to back + DIRECTION_BACK_TO_FRONT //!< Back top front + } Direction; + } WAVE_EFFECT_TYPE; + + //! Keyboards + namespace Keyboard + { + //! Definitions of keys. + typedef enum RZKEY + { + RZKEY_ESC = 0x0001, /*!< Esc (VK_ESCAPE) */ + RZKEY_F1 = 0x0003, /*!< F1 (VK_F1) */ + RZKEY_F2 = 0x0004, /*!< F2 (VK_F2) */ + RZKEY_F3 = 0x0005, /*!< F3 (VK_F3) */ + RZKEY_F4 = 0x0006, /*!< F4 (VK_F4) */ + RZKEY_F5 = 0x0007, /*!< F5 (VK_F5) */ + RZKEY_F6 = 0x0008, /*!< F6 (VK_F6) */ + RZKEY_F7 = 0x0009, /*!< F7 (VK_F7) */ + RZKEY_F8 = 0x000A, /*!< F8 (VK_F8) */ + RZKEY_F9 = 0x000B, /*!< F9 (VK_F9) */ + RZKEY_F10 = 0x000C, /*!< F10 (VK_F10) */ + RZKEY_F11 = 0x000D, /*!< F11 (VK_F11) */ + RZKEY_F12 = 0x000E, /*!< F12 (VK_F12) */ + RZKEY_1 = 0x0102, /*!< 1 (VK_1) */ + RZKEY_2 = 0x0103, /*!< 2 (VK_2) */ + RZKEY_3 = 0x0104, /*!< 3 (VK_3) */ + RZKEY_4 = 0x0105, /*!< 4 (VK_4) */ + RZKEY_5 = 0x0106, /*!< 5 (VK_5) */ + RZKEY_6 = 0x0107, /*!< 6 (VK_6) */ + RZKEY_7 = 0x0108, /*!< 7 (VK_7) */ + RZKEY_8 = 0x0109, /*!< 8 (VK_8) */ + RZKEY_9 = 0x010A, /*!< 9 (VK_9) */ + RZKEY_0 = 0x010B, /*!< 0 (VK_0) */ + RZKEY_A = 0x0302, /*!< A (VK_A) */ + RZKEY_B = 0x0407, /*!< B (VK_B) */ + RZKEY_C = 0x0405, /*!< C (VK_C) */ + RZKEY_D = 0x0304, /*!< D (VK_D) */ + RZKEY_E = 0x0204, /*!< E (VK_E) */ + RZKEY_F = 0x0305, /*!< F (VK_F) */ + RZKEY_G = 0x0306, /*!< G (VK_G) */ + RZKEY_H = 0x0307, /*!< H (VK_H) */ + RZKEY_I = 0x0209, /*!< I (VK_I) */ + RZKEY_J = 0x0308, /*!< J (VK_J) */ + RZKEY_K = 0x0309, /*!< K (VK_K) */ + RZKEY_L = 0x030A, /*!< L (VK_L) */ + RZKEY_M = 0x0409, /*!< M (VK_M) */ + RZKEY_N = 0x0408, /*!< N (VK_N) */ + RZKEY_O = 0x020A, /*!< O (VK_O) */ + RZKEY_P = 0x020B, /*!< P (VK_P) */ + RZKEY_Q = 0x0202, /*!< Q (VK_Q) */ + RZKEY_R = 0x0205, /*!< R (VK_R) */ + RZKEY_S = 0x0303, /*!< S (VK_S) */ + RZKEY_T = 0x0206, /*!< T (VK_T) */ + RZKEY_U = 0x0208, /*!< U (VK_U) */ + RZKEY_V = 0x0406, /*!< V (VK_V) */ + RZKEY_W = 0x0203, /*!< W (VK_W) */ + RZKEY_X = 0x0404, /*!< X (VK_X) */ + RZKEY_Y = 0x0207, /*!< Y (VK_Y) */ + RZKEY_Z = 0x0403, /*!< Z (VK_Z) */ + RZKEY_NUMLOCK = 0x0112, /*!< Numlock (VK_NUMLOCK) */ + RZKEY_NUMPAD0 = 0x0513, /*!< Numpad 0 (VK_NUMPAD0) */ + RZKEY_NUMPAD1 = 0x0412, /*!< Numpad 1 (VK_NUMPAD1) */ + RZKEY_NUMPAD2 = 0x0413, /*!< Numpad 2 (VK_NUMPAD2) */ + RZKEY_NUMPAD3 = 0x0414, /*!< Numpad 3 (VK_NUMPAD3) */ + RZKEY_NUMPAD4 = 0x0312, /*!< Numpad 4 (VK_NUMPAD4) */ + RZKEY_NUMPAD5 = 0x0313, /*!< Numpad 5 (VK_NUMPAD5) */ + RZKEY_NUMPAD6 = 0x0314, /*!< Numpad 6 (VK_NUMPAD6) */ + RZKEY_NUMPAD7 = 0x0212, /*!< Numpad 7 (VK_NUMPAD7) */ + RZKEY_NUMPAD8 = 0x0213, /*!< Numpad 8 (VK_NUMPAD8) */ + RZKEY_NUMPAD9 = 0x0214, /*!< Numpad 9 (VK_ NUMPAD9*/ + RZKEY_NUMPAD_DIVIDE = 0x0113, /*!< Divide (VK_DIVIDE) */ + RZKEY_NUMPAD_MULTIPLY = 0x0114, /*!< Multiply (VK_MULTIPLY) */ + RZKEY_NUMPAD_SUBTRACT = 0x0115, /*!< Subtract (VK_SUBTRACT) */ + RZKEY_NUMPAD_ADD = 0x0215, /*!< Add (VK_ADD) */ + RZKEY_NUMPAD_ENTER = 0x0415, /*!< Enter (VK_RETURN - Extended) */ + RZKEY_NUMPAD_DECIMAL = 0x0514, /*!< Decimal (VK_DECIMAL) */ + RZKEY_PRINTSCREEN = 0x000F, /*!< Print Screen (VK_PRINT) */ + RZKEY_SCROLL = 0x0010, /*!< Scroll Lock (VK_SCROLL) */ + RZKEY_PAUSE = 0x0011, /*!< Pause (VK_PAUSE) */ + RZKEY_INSERT = 0x010F, /*!< Insert (VK_INSERT) */ + RZKEY_HOME = 0x0110, /*!< Home (VK_HOME) */ + RZKEY_PAGEUP = 0x0111, /*!< Page Up (VK_PRIOR) */ + RZKEY_DELETE = 0x020f, /*!< Delete (VK_DELETE) */ + RZKEY_END = 0x0210, /*!< End (VK_END) */ + RZKEY_PAGEDOWN = 0x0211, /*!< Page Down (VK_NEXT) */ + RZKEY_UP = 0x0410, /*!< Up (VK_UP) */ + RZKEY_LEFT = 0x050F, /*!< Left (VK_LEFT) */ + RZKEY_DOWN = 0x0510, /*!< Down (VK_DOWN) */ + RZKEY_RIGHT = 0x0511, /*!< Right (VK_RIGHT) */ + RZKEY_TAB = 0x0201, /*!< Tab (VK_TAB) */ + RZKEY_CAPSLOCK = 0x0301, /*!< Caps Lock(VK_CAPITAL) */ + RZKEY_BACKSPACE = 0x010E, /*!< Backspace (VK_BACK) */ + RZKEY_ENTER = 0x030E, /*!< Enter (VK_RETURN) */ + RZKEY_LCTRL = 0x0501, /*!< Left Control(VK_LCONTROL) */ + RZKEY_LWIN = 0x0502, /*!< Left Window (VK_LWIN) */ + RZKEY_LALT = 0x0503, /*!< Left Alt (VK_LMENU) */ + RZKEY_SPACE = 0x0507, /*!< Spacebar (VK_SPACE) */ + RZKEY_RALT = 0x050B, /*!< Right Alt (VK_RMENU) */ + RZKEY_FN = 0x050C, /*!< Function key. */ + RZKEY_RMENU = 0x050D, /*!< Right Menu (VK_APPS) */ + RZKEY_RCTRL = 0x050E, /*!< Right Control (VK_RCONTROL) */ + RZKEY_LSHIFT = 0x0401, /*!< Left Shift (VK_LSHIFT) */ + RZKEY_RSHIFT = 0x040E, /*!< Right Shift (VK_RSHIFT) */ + RZKEY_MACRO1 = 0x0100, /*!< Macro Key 1 */ + RZKEY_MACRO2 = 0x0200, /*!< Macro Key 2 */ + RZKEY_MACRO3 = 0x0300, /*!< Macro Key 3 */ + RZKEY_MACRO4 = 0x0400, /*!< Macro Key 4 */ + RZKEY_MACRO5 = 0x0500, /*!< Macro Key 5 */ + RZKEY_OEM_1 = 0x0101, /*!< ~ (tilde/半角/全角) (VK_OEM_3) */ + RZKEY_OEM_2 = 0x010C, /*!< -- (minus) (VK_OEM_MINUS) */ + RZKEY_OEM_3 = 0x010D, /*!< = (equal) (VK_OEM_PLUS) */ + RZKEY_OEM_4 = 0x020C, /*!< [ (left sqaure bracket) (VK_OEM_4) */ + RZKEY_OEM_5 = 0x020D, /*!< ] (right square bracket) (VK_OEM_6) */ + RZKEY_OEM_6 = 0x020E, /*!< \ (backslash) (VK_OEM_5) */ + RZKEY_OEM_7 = 0x030B, /*!< ; (semi-colon) (VK_OEM_1) */ + RZKEY_OEM_8 = 0x030C, /*!< ' (apostrophe) (VK_OEM_7) */ + RZKEY_OEM_9 = 0x040A, /*!< , (comma) (VK_OEM_COMMA) */ + RZKEY_OEM_10 = 0x040B, /*!< . (period) (VK_OEM_PERIOD) */ + RZKEY_OEM_11 = 0x040C, /*!< / (forward slash) (VK_OEM_2) */ + RZKEY_EUR_1 = 0x030D, /*!< "#" (VK_OEM_5) */ + RZKEY_EUR_2 = 0x0402, /*!< \ (VK_OEM_102) */ + RZKEY_JPN_1 = 0x0015, /*!< ¥ (0xFF) */ + RZKEY_JPN_2 = 0x040D, /*!< \ (0xC1) */ + RZKEY_JPN_3 = 0x0504, /*!< 無変換 (VK_OEM_PA1) */ + RZKEY_JPN_4 = 0x0509, /*!< 変換 (0xFF) */ + RZKEY_JPN_5 = 0x050A, /*!< ひらがな/カタカナ (0xFF) */ + RZKEY_KOR_1 = 0x0015, /*!< | (0xFF) */ + RZKEY_KOR_2 = 0x030D, /*!< (VK_OEM_5) */ + RZKEY_KOR_3 = 0x0402, /*!< (VK_OEM_102) */ + RZKEY_KOR_4 = 0x040D, /*!< (0xC1) */ + RZKEY_KOR_5 = 0x0504, /*!< (VK_OEM_PA1) */ + RZKEY_KOR_6 = 0x0509, /*!< 한/영 (0xFF) */ + RZKEY_KOR_7 = 0x050A, /*!< (0xFF) */ + RZKEY_INVALID = 0xFFFF /*!< Invalid keys. */ + } RZKEY; + + //! Definition of LEDs. + typedef enum RZLED + { + RZLED_LOGO = 0x0014 /*!< Razer logo */ + } RZLED; + + //! Maximum number of rows in a keyboard. + const RZSIZE MAX_ROW = 6; + + //! Maximum number of columns in a keyboard. + const RZSIZE MAX_COLUMN = 22; + + //! Maximum number of keys. + const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; + + //! Maximum number of custom effects. + const RZSIZE MAX_CUSTOM_EFFECTS = MAX_KEYS; + + //! Keyboard LED layout. + const COLORREF RZKEY_LAYOUT[MAX_ROW][MAX_COLUMN] = {}; + + //! Chroma keyboard effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_BREATHING, //!< Breathing effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM, //!< Custom effect. + CHROMA_REACTIVE, //!< Reactive effect (This effect has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect has deprecated and should not be used). + CHROMA_WAVE, //!< Wave effect (This effect has deprecated and should not be used). + CHROMA_RESERVED, //!< Reserved. + CHROMA_CUSTOM_KEY, //!< Custom effects with keys. + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + // Chroma keyboard effects + //! Breathing effect type (This effect has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + //! Breathing effects. + enum Type + { + TWO_COLORS = 1, //!< 2 colors + RANDOM_COLORS, //!< Random colors + INVALID //!< Invalid type + } Type; + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect using a matrix type. + typedef struct CUSTOM_EFFECT_TYPE + { + COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. + } CUSTOM_EFFECT_TYPE; + + //! Custom effect with keys. + typedef struct CUSTOM_KEY_EFFECT_TYPE + { + COLORREF Color[MAX_ROW][MAX_COLUMN]; //!< Grid layout. 6 rows by 22 columns. + COLORREF Key[MAX_ROW][MAX_COLUMN]; //!< Keys information. 6 rows by 22 columns. To indidate there is a key effect, OR with 0x01000000. i.e. Key[0][1] = 0x01000000 | Color; + } CUSTOM_KEY_EFFECT_TYPE; + + //! Reactive effect type (This effect has deprecated and should not be used). + typedef struct REACTIVE_EFFECT_TYPE + { + //! Duration of the effect. + enum Duration + { + DURATION_NONE=0, //!< No duration. + DURATION_SHORT, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG, //!< Long duration. + DURATION_INVALID //!< Invalid duration. + } Duration; //!< The time taken for the effect to fade away. + + COLORREF Color; //!< Color of the effect + } REACTIVE_EFFECT_TYPE; + + //! Starlight effect (This effect has deprecated and should not be used). + typedef struct STARLIGHT_EFFECT_TYPE + { + //! Starlight effect types. + enum _Type + { + TWO_COLORS = 1, //!< 2 colors. + RANDOM_COLORS //!< Random colors + } Type; + + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + + //! Duration of the effect. + enum _Duration + { + DURATION_SHORT = 1, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG //!< Long duration. + } Duration; //!< The time taken for the effect to fade away. + + } STARLIGHT_EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + COLORREF Color; //!< Color of the effect + } STATIC_EFFECT_TYPE; + + //! Wave effect type (This effect has deprecated and should not be used). + typedef struct WAVE_EFFECT_TYPE + { + //! Direction of the wave effect. + enum Direction + { + DIRECTION_NONE=0, //!< No direction. + DIRECTION_LEFT_TO_RIGHT, //!< Left to right. + DIRECTION_RIGHT_TO_LEFT, //!< Right to left. + DIRECTION_INVALID //!< Invalid direction. + } Direction; //!< Direction of the wave. + } WAVE_EFFECT_TYPE; + } + + //! Mice + namespace Mouse + { + //! Maximum number of custom LEDs (old definition to maintain backward compatibility). + const RZSIZE MAX_LEDS = 30; + + //! Mice LED layout (old definition to maintain backward compatibility). + const RZCOLOR RZLED_LAYOUT[MAX_LEDS] = {}; + + //! Maximum number of rows of the virtual grid. + const RZSIZE MAX_ROW = 9; + + //! Maximum number of columns of the virtual grid. + const RZSIZE MAX_COLUMN = 7; + + //! Maximum number of LEDs of the virtual grid. + const RZSIZE MAX_LEDS2 = MAX_ROW * MAX_COLUMN; + + //! Mice LED virtual grid layout. + const RZCOLOR RZLED_LAYOUT2[MAX_ROW][MAX_COLUMN] = {}; + + //! Mouse LED Id defintion (This effect type has deprecated and should not be used). + typedef enum RZLED + { + RZLED_NONE = 0, //!< No LED. + RZLED_SCROLLWHEEL = 1, //!< Scroll Wheel LED. + RZLED_LOGO = 2, //!< Logo LED. + RZLED_BACKLIGHT = 3, //!< Backlight or numpad. + RZLED_SIDE_STRIP1 = 4, //!< Side strip LED 1. (For Mamba TE, starts from top left hand) + RZLED_SIDE_STRIP2 = 5, //!< Side strip LED 2. (For Mamba TE) + RZLED_SIDE_STRIP3 = 6, //!< Side strip LED 3. (For Mamba TE) + RZLED_SIDE_STRIP4 = 7, //!< Side strip LED 4. (For Mamba TE) + RZLED_SIDE_STRIP5 = 8, //!< Side strip LED 5. (For Mamba TE) + RZLED_SIDE_STRIP6 = 9, //!< Side strip LED 6. (For Mamba TE) + RZLED_SIDE_STRIP7 = 10, //!< Side strip LED 7. (For Mamba TE) + RZLED_SIDE_STRIP8 = 11, //!< Side strip LED 8. (For Mamba TE) + RZLED_SIDE_STRIP9 = 12, //!< Side strip LED 9. (For Mamba TE) + RZLED_SIDE_STRIP10 = 13, //!< Side strip LED 10. (For Mamba TE) + RZLED_SIDE_STRIP11 = 14, //!< Side strip LED 11. (For Mamba TE) + RZLED_SIDE_STRIP12 = 15, //!< Side strip LED 12. (For Mamba TE) + RZLED_SIDE_STRIP13 = 16, //!< Side strip LED 13. (For Mamba TE) + RZLED_SIDE_STRIP14 = 17, //!< Side strip LED 14. (For Mamba TE) + RZLED_ALL = 0xFFFF + } RZLED; + + //! Mouse LED Id defintion for the virtual grid. + typedef enum RZLED2 + { + RZLED2_SCROLLWHEEL = 0x0203, //!< Scroll Wheel LED. + RZLED2_LOGO = 0x0703, //!< Logo LED. + RZLED2_BACKLIGHT = 0x0403, //!< Backlight LED. + RZLED2_LEFT_SIDE1 = 0x0100, //!< Left LED 1. + RZLED2_LEFT_SIDE2 = 0x0200, //!< Left LED 2. + RZLED2_LEFT_SIDE3 = 0x0300, //!< Left LED 3. + RZLED2_LEFT_SIDE4 = 0x0400, //!< Left LED 4. + RZLED2_LEFT_SIDE5 = 0x0500, //!< Left LED 5. + RZLED2_LEFT_SIDE6 = 0x0600, //!< Left LED 6. + RZLED2_LEFT_SIDE7 = 0x0700, //!< Left LED 7. + RZLED2_BOTTOM1 = 0x0801, //!< Bottom LED 1. + RZLED2_BOTTOM2 = 0x0802, //!< Bottom LED 2. + RZLED2_BOTTOM3 = 0x0803, //!< Bottom LED 3. + RZLED2_BOTTOM4 = 0x0804, //!< Bottom LED 4. + RZLED2_BOTTOM5 = 0x0805, //!< Bottom LED 5. + RZLED2_RIGHT_SIDE1 = 0x0106, //!< Right LED 1. + RZLED2_RIGHT_SIDE2 = 0x0206, //!< Right LED 2. + RZLED2_RIGHT_SIDE3 = 0x0306, //!< Right LED 3. + RZLED2_RIGHT_SIDE4 = 0x0406, //!< Right LED 4. + RZLED2_RIGHT_SIDE5 = 0x0506, //!< Right LED 5. + RZLED2_RIGHT_SIDE6 = 0x0606, //!< Right LED 6. + RZLED2_RIGHT_SIDE7 = 0x0706 //!< Right LED 7. + } RZLED2; + + //! Chroma mouse effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_BLINKING, //!< Blinking effect (This effect has deprecated and should not be used). + CHROMA_BREATHING, //!< Breathing effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM, //!< Custom effect (old definition to maintain backward compatibility). + CHROMA_REACTIVE, //!< Reactive effect (This effect has deprecated and should not be used). + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_WAVE, //!< Wave effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM2, //!< Custom effects using a virtual grid. + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + RZLED LEDId; //!< LED Id + COLORREF Color; //!< Color of the effect. + } STATIC_EFFECT_TYPE; + + //! Blinking effect type (This effect has deprecated and should not be used). + typedef struct BLINKING_EFFECT_TYPE + { + RZLED LEDId; //!< LED Id + COLORREF Color; //!< Color. + } BLINKING_EFFECT_TYPE; + + //! Breathing effect (This effect has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + RZLED LEDId; //!< LED Id + + //! Breathing type. + enum Type + { + ONE_COLOR = 1, //!< 1 color (Only fill Color1). + TWO_COLORS, //!< 2 colors. + RANDOM_COLORS, //!< Random colors + INVALID //!< Invalid type + } Type; + + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect (This effect type has deprecated and should not be used). + typedef struct CUSTOM_EFFECT_TYPE + { + RZCOLOR Color[MAX_LEDS]; //!< Array of colors. + } CUSTOM_EFFECT_TYPE; + + //! Custom effect using virtual grid. + //! Indexes of the LED are defined in RZLED2.i.e. Row = HIBYTE(RZLED2_SCROLLWHEEL), Column = LOBYTE(RZLED2_SCROLLWHEEL) + typedef struct CUSTOM_EFFECT_TYPE2 + { + RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Array of colors. + } CUSTOM_EFFECT_TYPE2; + + //! Reactive effect (This effect has deprecated and should not be used). + typedef struct REACTIVE_EFFECT_TYPE + { + RZLED LEDId; //!< LED Id + + //! Duration of the effect. + enum Duration + { + DURATION_NONE=0, //!< No duration. + DURATION_SHORT, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG //!< Long duration. + } Duration; + + RZCOLOR Color; //!< Color of the effect. + } REACTIVE_EFFECT_TYPE; + + //! No effect (This effect has deprecated and should not be used). + typedef struct NO_EFFECT_TYPE + { + RZLED LEDId; //!< LED Id + } NO_EFFECT_TYPE; + + //! Spectrum cycling (This effect has deprecated and should not be used). + typedef struct SPECTRUMCYCLING_EFFECT_TYPE + { + RZLED LEDId; //!< LED id. + } SPECTRUMCYCLING_EFFECT_TYPE; + + //! Wave effect (This effect has deprecated and should not be used). + typedef struct WAVE_EFFECT_TYPE + { + //! Direction of the wave effect. + enum Direction + { + FRONT_TO_BACK, //!< Front to back + BACK_TO_FRONT //!< Back to front + } Direction; + } WAVE_EFFECT_TYPE; + } + + //! Headsets + namespace Headset + { + //! Maximum number of LEDs + const RZSIZE MAX_LEDS = 5; + + //! Chroma headset effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_STATIC, //!< Static effect. + CHROMA_BREATHING, //!< Breathing effect (This effect has deprecated and should not be used). + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM, //!< Custom effects. + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + COLORREF Color; //!< Color of the effect. + } STATIC_EFFECT_TYPE; + + //! Breathing effect type (This effect has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + COLORREF Color; //!< Color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect type. + typedef struct CUSTOM_EFFECT_TYPE + { + RZCOLOR Color[MAX_LEDS]; //!< Array of colors. + } CUSTOM_EFFECT_TYPE; + } + + //! Mousepads + namespace Mousepad + { + //! Maximum number of LEDs + const RZSIZE MAX_LEDS = 15; + + //! Chroma mousepad effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_BREATHING, //!< Breathing effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM, //!< Custom effect. + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_WAVE, //!< Wave effect (This effect has deprecated and should not be used). + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + // Chroma mousepad effects + //! Breathing effect type (This effect has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + //! Breathing effects. + enum Type + { + TWO_COLORS = 1, //!< 2 colors + RANDOM_COLORS, //!< Random colors + INVALID + } Type; + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect type. + typedef struct CUSTOM_EFFECT_TYPE + { + RZCOLOR Color[MAX_LEDS]; //!< An array of colors for all the sides of the mousepad. First LED starts from top-right corner. + //!< LED 0-4 right side, 5-9 bottom side, 10-14 left side. + } CUSTOM_EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + COLORREF Color; //!< Color of the effect + } STATIC_EFFECT_TYPE; + + //! Wave effect type + typedef struct WAVE_EFFECT_TYPE + { + //! Direction of the wave effect. + enum Direction + { + DIRECTION_NONE=0, //!< No direction. + DIRECTION_LEFT_TO_RIGHT, //!< Left to right. + DIRECTION_RIGHT_TO_LEFT, //!< Right to left. + DIRECTION_INVALID //!< Invalid direction. + } Direction; //!< Direction of the wave. + } WAVE_EFFECT_TYPE; + } + + //! Keypads + namespace Keypad + { + //! Maximum number of rows. + const RZSIZE MAX_ROW = 4; + + //! Maximum number of columns. + const RZSIZE MAX_COLUMN = 5; + + //! Total number of keys. + const RZSIZE MAX_KEYS = MAX_ROW * MAX_COLUMN; + + //! Chroma keypad effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_BREATHING, //!< Breathing effect (This effect has deprecated and should not be used). + CHROMA_CUSTOM, //!< Custom effect. + CHROMA_REACTIVE, //!< Reactive effect (This effect has deprecated and should not be used). + CHROMA_SPECTRUMCYCLING, //!< Spectrum cycling effect (This effect has deprecated and should not be used). + CHROMA_STATIC, //!< Static effect. + CHROMA_WAVE, //!< Wave effect (This effect has deprecated and should not be used). + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + // Chroma keypad effects + //! Breathing effect type (This effect has deprecated and should not be used). + typedef struct BREATHING_EFFECT_TYPE + { + //! Breathing effects. + enum Type + { + TWO_COLORS = 1, //!< 2 colors + RANDOM_COLORS, //!< Random colors + INVALID //!< Invalid type + } Type; + COLORREF Color1; //!< First color. + COLORREF Color2; //!< Second color. + } BREATHING_EFFECT_TYPE; + + //! Custom effect type + typedef struct CUSTOM_EFFECT_TYPE + { + RZCOLOR Color[MAX_ROW][MAX_COLUMN]; //!< Custom effect. + //!< For Razer Tartarus Chroma only Color[0] is valid. Use index '0' to change the keypad color. + } CUSTOM_EFFECT_TYPE; + + //! Reactive effect type (This effect has deprecated and should not be used). + typedef struct REACTIVE_EFFECT_TYPE + { + //! Duration of the effect. + enum Duration + { + DURATION_NONE=0, //!< No duration. + DURATION_SHORT, //!< Short duration. + DURATION_MEDIUM, //!< Medium duration. + DURATION_LONG, //!< Long duration. + DURATION_INVALID //!< Invalid duration. + } Duration; //!< The time taken for the effect to fade away. + + COLORREF Color; //!< Color of the effect + } REACTIVE_EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + RZCOLOR Color; //!< Color of the effect. + } STATIC_EFFECT_TYPE; + + //! Wave effect type (This effect has deprecated and should not be used). + typedef struct WAVE_EFFECT_TYPE + { + //! Direction of the wave effect. + enum Direction + { + DIRECTION_NONE=0, //!< No direction. + DIRECTION_LEFT_TO_RIGHT, //!< Left to right. + DIRECTION_RIGHT_TO_LEFT, //!< Right to left. + DIRECTION_INVALID //!< Invalid direction. + } Direction; //!< Direction of the wave. + } WAVE_EFFECT_TYPE; + } + + //! Chroma Link + namespace ChromaLink + { + //! Maximum number of elements/LEDs + const RZSIZE MAX_LEDS = 5; + + //! Chroma Link effect types + typedef enum EFFECT_TYPE + { + CHROMA_NONE = 0, //!< No effect. + CHROMA_CUSTOM, //!< Custom effect. + CHROMA_STATIC, //!< Static effect. + CHROMA_INVALID //!< Invalid effect. + } EFFECT_TYPE; + + //! Custom effect type + typedef struct CUSTOM_EFFECT_TYPE + { + RZCOLOR Color[MAX_LEDS]; //!< Array of colors. + } CUSTOM_EFFECT_TYPE; + + //! Static effect type + typedef struct STATIC_EFFECT_TYPE + { + RZCOLOR Color; //!< Color of the effect. + } STATIC_EFFECT_TYPE; + } +} + +#endif diff --git a/UniLight/razer/RzErrors.h b/UniLight/razer/RzErrors.h new file mode 100644 index 0000000..6d3f29b --- /dev/null +++ b/UniLight/razer/RzErrors.h @@ -0,0 +1,46 @@ + +//! \file RzErrors.h +//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK. + +#ifndef _RZERRORS_H_ +#define _RZERRORS_H_ + +#pragma once + +// Error codes +//! Invalid +#define RZRESULT_INVALID -1L +//! Success +#define RZRESULT_SUCCESS 0L +//! Access denied +#define RZRESULT_ACCESS_DENIED 5L +//! Invalid handle +#define RZRESULT_INVALID_HANDLE 6L +//! Not supported +#define RZRESULT_NOT_SUPPORTED 50L +//! Invalid parameter. +#define RZRESULT_INVALID_PARAMETER 87L +//! The service has not been started +#define RZRESULT_SERVICE_NOT_ACTIVE 1062L +//! Cannot start more than one instance of the specified program. +#define RZRESULT_SINGLE_INSTANCE_APP 1152L +//! Device not connected +#define RZRESULT_DEVICE_NOT_CONNECTED 1167L +//! Element not found. +#define RZRESULT_NOT_FOUND 1168L +//! Request aborted. +#define RZRESULT_REQUEST_ABORTED 1235L +//! An attempt was made to perform an initialization operation when initialization has already been completed. +#define RZRESULT_ALREADY_INITIALIZED 1247L +//! Resource not available or disabled +#define RZRESULT_RESOURCE_DISABLED 4309L +//! Device not available or supported +#define RZRESULT_DEVICE_NOT_AVAILABLE 4319L +//! The group or resource is not in the correct state to perform the requested operation. +#define RZRESULT_NOT_VALID_STATE 5023L +//! No more items +#define RZRESULT_NO_MORE_ITEMS 259L +//! General failure. +#define RZRESULT_FAILED 2147500037L + +#endif From e247ea4adc8f196010bde977d5977d2274f2ebc4 Mon Sep 17 00:00:00 2001 From: HunterZ <> Date: Mon, 29 Oct 2018 23:25:16 -0700 Subject: [PATCH 2/3] Move all vendor-provided stuff to cots subdirs and add disclaimer Commit cots headers for convenience --- .gitignore | 4 - UniLight/CUEUtil.cpp | 2 +- UniLight/LFXUtil.cpp | 2 +- UniLight/LLEDUtil.cpp | 2 +- UniLight/RZCUtil.cpp | 6 +- UniLight/UniLight.vcxproj | 3 +- UniLight/cots/README.md | 1 + UniLight/cots/corsair/CUESDK.h | 170 +++++++ UniLight/cots/corsair/CUESDKGlobal.h | 15 + UniLight/cots/corsair/CorsairKeyIdEnum.h | 40 ++ UniLight/cots/corsair/CorsairLedIdEnum.h | 214 +++++++++ UniLight/cots/dell/LFX2.h | 439 ++++++++++++++++++ UniLight/{ => cots/dell}/LFXDecl.h | 0 UniLight/cots/logitech/LogitechLEDLib.h | 188 ++++++++ UniLight/{ => cots}/razer/ChromaAppInfo.xml | 0 .../{ => cots}/razer/RzChromaSDKDefines.h | 0 UniLight/{ => cots}/razer/RzChromaSDKTypes.h | 0 UniLight/{ => cots}/razer/RzErrors.h | 0 UniLight/resource.h | Bin 912 -> 440 bytes 19 files changed, 1075 insertions(+), 11 deletions(-) create mode 100644 UniLight/cots/README.md create mode 100644 UniLight/cots/corsair/CUESDK.h create mode 100644 UniLight/cots/corsair/CUESDKGlobal.h create mode 100644 UniLight/cots/corsair/CorsairKeyIdEnum.h create mode 100644 UniLight/cots/corsair/CorsairLedIdEnum.h create mode 100644 UniLight/cots/dell/LFX2.h rename UniLight/{ => cots/dell}/LFXDecl.h (100%) create mode 100644 UniLight/cots/logitech/LogitechLEDLib.h rename UniLight/{ => cots}/razer/ChromaAppInfo.xml (100%) rename UniLight/{ => cots}/razer/RzChromaSDKDefines.h (100%) rename UniLight/{ => cots}/razer/RzChromaSDKTypes.h (100%) rename UniLight/{ => cots}/razer/RzErrors.h (100%) diff --git a/.gitignore b/.gitignore index f7299c0..07d28ae 100644 --- a/.gitignore +++ b/.gitignore @@ -7,11 +7,7 @@ *.tlog *.user .vs -CUESDK* -Corsair*.h Debug/ -LFX2.h -LogitechLEDLib.* Release/ UniLight*.zip UniLight.exe diff --git a/UniLight/CUEUtil.cpp b/UniLight/CUEUtil.cpp index c9cd8e5..8dbab57 100644 --- a/UniLight/CUEUtil.cpp +++ b/UniLight/CUEUtil.cpp @@ -2,7 +2,7 @@ #include "CUEUtil.h" -#include "CUESDK.h" +#include "cots/corsair/CUESDK.h" #include #include diff --git a/UniLight/LFXUtil.cpp b/UniLight/LFXUtil.cpp index 3f0615e..d35ac0a 100644 --- a/UniLight/LFXUtil.cpp +++ b/UniLight/LFXUtil.cpp @@ -2,7 +2,7 @@ #include "LFXUtil.h" -#include "LFX2.h" +#include "cots/dell/LFX2.h" #include #include diff --git a/UniLight/LLEDUtil.cpp b/UniLight/LLEDUtil.cpp index 9e446ad..2c11d2a 100644 --- a/UniLight/LLEDUtil.cpp +++ b/UniLight/LLEDUtil.cpp @@ -2,7 +2,7 @@ #include "LLEDUtil.h" -#include "LogitechLEDLib.h" +#include "cots/logitech/LogitechLEDLib.h" #include namespace diff --git a/UniLight/RZCUtil.cpp b/UniLight/RZCUtil.cpp index b1bbdb9..763ea02 100644 --- a/UniLight/RZCUtil.cpp +++ b/UniLight/RZCUtil.cpp @@ -5,9 +5,9 @@ #include #include #include // COLORREF, HMODULE -#include "razer/RzChromaSDKDefines.h" -#include "razer/RzChromaSDKTypes.h" -#include "razer/RzErrors.h" +#include "cots/razer/RzChromaSDKDefines.h" +#include "cots/razer/RzChromaSDKTypes.h" +#include "cots/razer/RzErrors.h" //#ifdef _WIN64 //#define CHROMASDKDLL _T("RzChromaSDK64.dll") diff --git a/UniLight/UniLight.vcxproj b/UniLight/UniLight.vcxproj index d2895cd..cb1da6d 100644 --- a/UniLight/UniLight.vcxproj +++ b/UniLight/UniLight.vcxproj @@ -150,6 +150,7 @@ true false kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;dwmapi.lib;Wtsapi32.lib;CUESDK_2015.lib;LogitechLEDLib.lib;%(AdditionalDependencies) + cots\corsair;cots\logitech;%(AdditionalLibraryDirectories) @@ -172,4 +173,4 @@ - + \ No newline at end of file diff --git a/UniLight/cots/README.md b/UniLight/cots/README.md new file mode 100644 index 0000000..973e110 --- /dev/null +++ b/UniLight/cots/README.md @@ -0,0 +1 @@ +All files under this directory are dependencies that are owned by their respective vendors. I do not claim any rights to them, nor do I promise to offer any support. diff --git a/UniLight/cots/corsair/CUESDK.h b/UniLight/cots/corsair/CUESDK.h new file mode 100644 index 0000000..0a56c9a --- /dev/null +++ b/UniLight/cots/corsair/CUESDK.h @@ -0,0 +1,170 @@ +#pragma once + +#include "CUESDKGlobal.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "CorsairLedIdEnum.h" +#include "CorsairKeyIdEnum.h" + + enum CorsairDeviceType // contains list of available device types + { + CDT_Unknown = 0, + CDT_Mouse = 1, + CDT_Keyboard = 2, + CDT_Headset = 3, + CDT_MouseMat = 4, + CDT_HeadsetStand = 5 + }; + + enum CorsairPhysicalLayout // contains list of available physical layouts for keyboards + { + CPL_Invalid = 0, // dummy value + + CPL_US = 1, + CPL_UK = 2, + CPL_BR = 3, + CPL_JP = 4, + CPL_KR = 5, // valid values for keyboard + + CPL_Zones1 = 6, + CPL_Zones2 = 7, + CPL_Zones3 = 8, + CPL_Zones4 = 9 // valid values for mouse + }; + + enum CorsairLogicalLayout // contains list of available logical layouts for keyboards + { + CLL_Invalid = 0, // dummy value + CLL_US_Int = 1, + CLL_NA = 2, + CLL_EU = 3, + CLL_UK = 4, + CLL_BE = 5, + CLL_BR = 6, + CLL_CH = 7, + CLL_CN = 8, + CLL_DE = 9, + CLL_ES = 10, + CLL_FR = 11, + CLL_IT = 12, + CLL_ND = 13, + CLL_RU = 14, + CLL_JP = 15, + CLL_KR = 16, + CLL_TW = 17, + CLL_MEX = 18 + }; + + enum CorsairDeviceCaps // contains list of device capabilities + { + CDC_None = 0, // for devices that do not support any SDK functions + CDC_Lighting = 1 // for devices that has controlled lighting + }; + + enum CorsairAccessMode // contains list of available SDK access modes + { + CAM_ExclusiveLightingControl = 0 + }; + + enum CorsairError // contains shared list of all errors which could happen during calling of Corsair* functions + { + CE_Success, // if previously called function completed successfully + CE_ServerNotFound, // CUE is not running or was shut down or third-party control is disabled in CUE settings(runtime error) + CE_NoControl, // if some other client has or took over exclusive control (runtime error) + CE_ProtocolHandshakeMissing, // if developer did not perform protocol handshake(developer error) + CE_IncompatibleProtocol, // if developer is calling the function that is not supported by the server(either because protocol has broken by server or client or because the function is new and server is too old. Check CorsairProtocolDetails for details) (developer error) + CE_InvalidArguments, // if developer supplied invalid arguments to the function(for specifics look at function descriptions). (developer error) + }; + + struct CorsairDeviceInfo // contains information about device + { + CorsairDeviceType type; // enum describing device type + const char* model; // null - terminated device model(like “K95RGB”) + CorsairPhysicalLayout physicalLayout; // enum describing physical layout of the keyboard or mouse + CorsairLogicalLayout logicalLayout; // enum describing logical layout of the keyboard as set in CUE settings + int capsMask; // mask that describes device capabilities, formed as logical “or” of CorsairDeviceCaps enum values + int ledsCount; // number of controllable LEDs on the device + }; + + struct CorsairLedPosition // contains led id and position of led rectangle.Most of the keys are rectangular.In case if key is not rectangular(like Enter in ISO / UK layout) it returns the smallest rectangle that fully contains the key + { + CorsairLedId ledId; // identifier of led + double top; + double left; + double height; + double width; // values in mm + }; + + struct CorsairLedPositions // contains number of leds and arrays with their positions + { + int numberOfLed; // integer value.Number of elements in following array + CorsairLedPosition* pLedPosition; // array of led positions + }; + + struct CorsairLedColor // contains information about led and its color + { + CorsairLedId ledId; // identifier of LED to set + int r; // red brightness[0..255] + int g; // green brightness[0..255] + int b; // blue brightness[0..255] + }; + + struct CorsairProtocolDetails // contains information about SDK and CUE versions + { + const char* sdkVersion; // null - terminated string containing version of SDK(like “1.0.0.1”). Always contains valid value even if there was no CUE found + const char* serverVersion; // null - terminated string containing version of CUE(like “1.0.0.1”) or NULL if CUE was not found. + int sdkProtocolVersion; // integer number that specifies version of protocol that is implemented by current SDK. Numbering starts from 1. Always contains valid value even if there was no CUE found + int serverProtocolVersion; // integer number that specifies version of protocol that is implemented by CUE. Numbering starts from 1. If CUE was not found then this value will be 0 + bool breakingChanges; // boolean value that specifies if there were breaking changes between version of protocol implemented by server and client + }; + + + + // set specified leds to some colors.The color is retained until changed by successive calls.This function does not take logical layout into account + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairSetLedsColors(int size, CorsairLedColor* ledsColors); + + // get current color for the list of requested LEDs + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairGetLedsColors(int size, CorsairLedColor* ledsColors); + + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairSetLedsColorsAsync(int size, CorsairLedColor* ledsColors, void(*CallbackType)(void*, bool, CorsairError), void *context); + + // returns number of connected Corsair devices that support lighting control. + CORSAIR_LIGHTING_SDK_EXPORT int CorsairGetDeviceCount(); + + // returns information about device at provided index + CORSAIR_LIGHTING_SDK_EXPORT CorsairDeviceInfo *CorsairGetDeviceInfo(int deviceIndex); + + // provides list of keyboard LEDs with their physical positions. + CORSAIR_LIGHTING_SDK_EXPORT CorsairLedPositions *CorsairGetLedPositions(); + + // provides list of keyboard or mousemat LEDs with their physical positions. + CORSAIR_LIGHTING_SDK_EXPORT CorsairLedPositions *CorsairGetLedPositionsByDeviceIndex(int deviceIndex); + + // retrieves led id for key name taking logical layout into account. + CORSAIR_LIGHTING_SDK_EXPORT CorsairLedId CorsairGetLedIdForKeyName(char keyName); + + // requestes control using specified access mode. By default client has shared control over lighting so there is no need to call CorsairRequestControl unless client requires exclusive control + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairRequestControl(CorsairAccessMode accessMode); + + // checks file and protocol version of CUE to understand which of SDK functions can be used with this version of CUE + CORSAIR_LIGHTING_SDK_EXPORT CorsairProtocolDetails CorsairPerformProtocolHandshake(); + + // returns last error that occured while using any of Corsair* functions + CORSAIR_LIGHTING_SDK_EXPORT CorsairError CorsairGetLastError(); + + //releases previously requested control for specified access mode + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairReleaseControl(CorsairAccessMode accessMode); + + // set layer priority for this shared client + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairSetLayerPriority(int priority); + + // registers a callback that will be called by SDK when some of G or M keys are pressed or released + CORSAIR_LIGHTING_SDK_EXPORT bool CorsairRegisterKeypressCallback(void (*CallbackType)(void *context, CorsairKeyId keyId, bool pressed), void *context); + +#ifdef __cplusplus +} //exten "C" +#endif diff --git a/UniLight/cots/corsair/CUESDKGlobal.h b/UniLight/cots/corsair/CUESDKGlobal.h new file mode 100644 index 0000000..d97367f --- /dev/null +++ b/UniLight/cots/corsair/CUESDKGlobal.h @@ -0,0 +1,15 @@ +#pragma once + +#ifndef _LIB +# if defined(_WIN32) || defined(WIN32) +# if defined(CORSAIR_LIGHTING_SDK_DLL) || defined(CUESDK_EXPORTS) +# define CORSAIR_LIGHTING_SDK_EXPORT __declspec(dllexport) +# else +# define CORSAIR_LIGHTING_SDK_EXPORT __declspec(dllimport) +# endif +# else +# define CORSAIR_LIGHTING_SDK_EXPORT __attribute__((visibility("default"))) +# endif // WIN32 +#else +# define CORSAIR_LIGHTING_SDK_EXPORT +#endif // !_LIB diff --git a/UniLight/cots/corsair/CorsairKeyIdEnum.h b/UniLight/cots/corsair/CorsairKeyIdEnum.h new file mode 100644 index 0000000..5e669bd --- /dev/null +++ b/UniLight/cots/corsair/CorsairKeyIdEnum.h @@ -0,0 +1,40 @@ +#pragma once + +enum CorsairKeyId +{ + CorsairKey_Invalid = 0, + + CorsairKeyKb_G1 = 1, + CorsairKeyKb_G2 = 2, + CorsairKeyKb_G3 = 3, + CorsairKeyKb_G4 = 4, + CorsairKeyKb_G5 = 5, + CorsairKeyKb_G6 = 6, + CorsairKeyKb_G7 = 7, + CorsairKeyKb_G8 = 8, + CorsairKeyKb_G9 = 9, + CorsairKeyKb_G10 = 10, + CorsairKeyKb_G11 = 11, + CorsairKeyKb_G12 = 12, + CorsairKeyKb_G13 = 13, + CorsairKeyKb_G14 = 14, + CorsairKeyKb_G15 = 15, + CorsairKeyKb_G16 = 16, + CorsairKeyKb_G17 = 17, + CorsairKeyKb_G18 = 18, + + CorsairKeyMouse_M1 = 19, + CorsairKeyMouse_M2 = 20, + CorsairKeyMouse_M3 = 21, + CorsairKeyMouse_M4 = 22, + CorsairKeyMouse_M5 = 23, + CorsairKeyMouse_M6 = 24, + CorsairKeyMouse_M7 = 25, + CorsairKeyMouse_M8 = 26, + CorsairKeyMouse_M9 = 27, + CorsairKeyMouse_M10 = 28, + CorsairKeyMouse_M11 = 29, + CorsairKeyMouse_M12 = 30, + + CorsairKey_Last = CorsairKeyMouse_M12 +}; diff --git a/UniLight/cots/corsair/CorsairLedIdEnum.h b/UniLight/cots/corsair/CorsairLedIdEnum.h new file mode 100644 index 0000000..512244c --- /dev/null +++ b/UniLight/cots/corsair/CorsairLedIdEnum.h @@ -0,0 +1,214 @@ +#pragma once + +enum CorsairLedId +{ + CLI_Invalid = 0, + CLK_Escape = 1, + CLK_F1 = 2, + CLK_F2 = 3, + CLK_F3 = 4, + CLK_F4 = 5, + CLK_F5 = 6, + CLK_F6 = 7, + CLK_F7 = 8, + CLK_F8 = 9, + CLK_F9 = 10, + CLK_F10 = 11, + CLK_F11 = 12, + CLK_GraveAccentAndTilde = 13, + CLK_1 = 14, + CLK_2 = 15, + CLK_3 = 16, + CLK_4 = 17, + CLK_5 = 18, + CLK_6 = 19, + CLK_7 = 20, + CLK_8 = 21, + CLK_9 = 22, + CLK_0 = 23, + CLK_MinusAndUnderscore = 24, + CLK_Tab = 25, + CLK_Q = 26, + CLK_W = 27, + CLK_E = 28, + CLK_R = 29, + CLK_T = 30, + CLK_Y = 31, + CLK_U = 32, + CLK_I = 33, + CLK_O = 34, + CLK_P = 35, + CLK_BracketLeft = 36, + CLK_CapsLock = 37, + CLK_A = 38, + CLK_S = 39, + CLK_D = 40, + CLK_F = 41, + CLK_G = 42, + CLK_H = 43, + CLK_J = 44, + CLK_K = 45, + CLK_L = 46, + CLK_SemicolonAndColon = 47, + CLK_ApostropheAndDoubleQuote = 48, + CLK_LeftShift = 49, + CLK_NonUsBackslash = 50, + CLK_Z = 51, + CLK_X = 52, + CLK_C = 53, + CLK_V = 54, + CLK_B = 55, + CLK_N = 56, + CLK_M = 57, + CLK_CommaAndLessThan = 58, + CLK_PeriodAndBiggerThan = 59, + CLK_SlashAndQuestionMark = 60, + CLK_LeftCtrl = 61, + CLK_LeftGui = 62, + CLK_LeftAlt = 63, + CLK_Lang2 = 64, + CLK_Space = 65, + CLK_Lang1 = 66, + CLK_International2 = 67, + CLK_RightAlt = 68, + CLK_RightGui = 69, + CLK_Application = 70, + CLK_LedProgramming = 71, + CLK_Brightness = 72, + CLK_F12 = 73, + CLK_PrintScreen = 74, + CLK_ScrollLock = 75, + CLK_PauseBreak = 76, + CLK_Insert = 77, + CLK_Home = 78, + CLK_PageUp = 79, + CLK_BracketRight = 80, + CLK_Backslash = 81, + CLK_NonUsTilde = 82, + CLK_Enter = 83, + CLK_International1 = 84, + CLK_EqualsAndPlus = 85, + CLK_International3 = 86, + CLK_Backspace = 87, + CLK_Delete = 88, + CLK_End = 89, + CLK_PageDown = 90, + CLK_RightShift = 91, + CLK_RightCtrl = 92, + CLK_UpArrow = 93, + CLK_LeftArrow = 94, + CLK_DownArrow = 95, + CLK_RightArrow = 96, + CLK_WinLock = 97, + CLK_Mute = 98, + CLK_Stop = 99, + CLK_ScanPreviousTrack = 100, + CLK_PlayPause = 101, + CLK_ScanNextTrack = 102, + CLK_NumLock = 103, + CLK_KeypadSlash = 104, + CLK_KeypadAsterisk = 105, + CLK_KeypadMinus = 106, + CLK_KeypadPlus = 107, + CLK_KeypadEnter = 108, + CLK_Keypad7 = 109, + CLK_Keypad8 = 110, + CLK_Keypad9 = 111, + CLK_KeypadComma = 112, + CLK_Keypad4 = 113, + CLK_Keypad5 = 114, + CLK_Keypad6 = 115, + CLK_Keypad1 = 116, + CLK_Keypad2 = 117, + CLK_Keypad3 = 118, + CLK_Keypad0 = 119, + CLK_KeypadPeriodAndDelete = 120, + CLK_G1 = 121, + CLK_G2 = 122, + CLK_G3 = 123, + CLK_G4 = 124, + CLK_G5 = 125, + CLK_G6 = 126, + CLK_G7 = 127, + CLK_G8 = 128, + CLK_G9 = 129, + CLK_G10 = 130, + CLK_VolumeUp = 131, + CLK_VolumeDown = 132, + CLK_MR = 133, + CLK_M1 = 134, + CLK_M2 = 135, + CLK_M3 = 136, + CLK_G11 = 137, + CLK_G12 = 138, + CLK_G13 = 139, + CLK_G14 = 140, + CLK_G15 = 141, + CLK_G16 = 142, + CLK_G17 = 143, + CLK_G18 = 144, + CLK_International5 = 145, + CLK_International4 = 146, + CLK_Fn = 147, + + CLM_1 = 148, + CLM_2 = 149, + CLM_3 = 150, + CLM_4 = 151, + + CLH_LeftLogo = 152, + CLH_RightLogo = 153, + + CLK_Logo = 154, + + CLMM_Zone1 = 155, + CLMM_Zone2 = 156, + CLMM_Zone3 = 157, + CLMM_Zone4 = 158, + CLMM_Zone5 = 159, + CLMM_Zone6 = 160, + CLMM_Zone7 = 161, + CLMM_Zone8 = 162, + CLMM_Zone9 = 163, + CLMM_Zone10 = 164, + CLMM_Zone11 = 165, + CLMM_Zone12 = 166, + CLMM_Zone13 = 167, + CLMM_Zone14 = 168, + CLMM_Zone15 = 169, + + CLKLP_Zone1 = 170, + CLKLP_Zone2 = 171, + CLKLP_Zone3 = 172, + CLKLP_Zone4 = 173, + CLKLP_Zone5 = 174, + CLKLP_Zone6 = 175, + CLKLP_Zone7 = 176, + CLKLP_Zone8 = 177, + CLKLP_Zone9 = 178, + CLKLP_Zone10 = 179, + CLKLP_Zone11 = 180, + CLKLP_Zone12 = 181, + CLKLP_Zone13 = 182, + CLKLP_Zone14 = 183, + CLKLP_Zone15 = 184, + CLKLP_Zone16 = 185, + CLKLP_Zone17 = 186, + CLKLP_Zone18 = 187, + CLKLP_Zone19 = 188, + + CLM_5 = 189, + CLM_6 = 190, + + CLHSS_Zone1 = 191, + CLHSS_Zone2 = 192, + CLHSS_Zone3 = 193, + CLHSS_Zone4 = 194, + CLHSS_Zone5 = 195, + CLHSS_Zone6 = 196, + CLHSS_Zone7 = 197, + CLHSS_Zone8 = 198, + CLHSS_Zone9 = 199, + + CLI_Last = CLHSS_Zone9 +}; diff --git a/UniLight/cots/dell/LFX2.h b/UniLight/cots/dell/LFX2.h new file mode 100644 index 0000000..3e89cf8 --- /dev/null +++ b/UniLight/cots/dell/LFX2.h @@ -0,0 +1,439 @@ +/********************************************************* + +LFX2.h - Defines the exports for the LightFX 2.0 DLL + +Purpose: Provide library exports for communicating with + the LightFX 2.0 API + +Copyright (c) 2007 Dell, Inc. All rights reserved. + Date: 8/7/2007 + +Dell, Inc. makes no warranty of any kind with regard +to this material, including, but not limited to, the +implied warranties of merchantability and fitness for +a particular purpose. Dell, Inc. shall not be liable +for any errors contained herein, or for incidental or +consequential damages in connection with the furnishing, +performance or use of this material. + +This document contains proprietary information which +is protected by copyright. All rights reserved. +Reproduction without the written permission of Dell +is strictly forbidden. + +**********************************************************/ + +#pragma once + +#include "LFXDecl.h" +#define _EXPORTING + +#ifdef _EXPORTING // To be used by SDK developer + #define FN_DECLSPEC __declspec(dllexport) + +#elif _IMPORTING // To be used for dynamic linking to dll + #define FN_DECLSPEC __declspec(dllimport) + +#else // To be used for linking using static library + #define FN_DECLSPEC +#endif + +#ifdef _STDCALL_SUPPORTED + #define STDCALL __stdcall // Declare our calling convention +#else + #define STDCALL +#endif // STDCALL_SUPPORTED + +#ifdef __cplusplus +extern "C" { +#endif + +// LightFX 2.0 DLL export function declarations + +/********************************************************* +Function: LFX_Initialize +Description: + Initializes the LightFX 2.0 system. + This function must be called prior to any other library calls being made. If this + function is not called, the system will not be initialized and the other functions + will return LFX_ERROR_NOINIT or LFX_FAILURE. +Inputs: None +Outputs: None +Returns: + LFX_SUCCESS if the system is successfully initialized, or was already initialized. + LFX_ERROR_NODEVS if the system is initialized, but no devices are available. + LFX_FAILURE if initialization fails. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_Initialize(); + +/********************************************************* +Function: LFX_Release +Description: + Release the LightFX 2.0 system. + This function may be called when the system is no longer needed. If this + function is not called, release will still occur on process detach. +PnP Note: + An application may want to release the system and initialize it again in + response to a device arrival notification, to account for new devices added + while the application is running. +Inputs: None +Outputs: None +Returns: + LFX_SUCCESS +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_Release(); + +/********************************************************* +Function: LFX_Reset +Description: + Reset the state of the system to 'off' for any lights attached to any devices. + Note that the change(s) to the physical light(s) do not occur immediately, rather + only after an LFX_Update() call is made. + To disable all lights, call LFX_Reset(), immediately followed by LFX_Update(). +Inputs: None +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if there are no devices available to reset. + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_Reset(); + +/********************************************************* +Function: LFX_Update +Description: + Update the entire system, submitting any state changes to hardware + made since the last LFX_Reset() call. +Inputs: None +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available. + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_Update(); + +/********************************************************* +Function: LFX_UpdateDefault +Description: + Update the entire system, submitting any state changes made since the last LFX_Reset() + call to the hardware, and set the appropriate flags to make the new state the + power-on default. +Note: Not all devices will support this functionality. +Inputs: None +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_UpdateDefault(); + +/********************************************************* +Function: LFX_GetNumDevices +Description: + Get the number of devices attached to the LightFX system +Inputs: None +Outputs: Populates a uint with the current number of attached devices. +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available, leaving the param untouched. + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumDevices(unsigned int* const); + +/********************************************************* +Function: LFX_GetDeviceDescription +Description: + Get the description of a device attached to the system +Inputs: Accepts an index to the device +Outputs: + Populates a character string with the device's description + Populates a ushort with the device type (see LFXDecl.h for device types) +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available. + LFX_ERROR_BUFFSIZE if the buffer provided is too small. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetDeviceDescription(const unsigned int, char* const, const unsigned int, unsigned char* const); + +/********************************************************* +Function: LFX_GetNumLights +Description: + Get the number of lights attached to a device in the LightFX system +Inputs: Accepts an index to the device +Outputs: Populates a uint with the current number of attached lights for the device index. +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided. + LFX_ERROR_NOLIGHTS if no lights are available at the device index provided. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetNumLights(const unsigned int, unsigned int* const); + +/********************************************************* +Function: LFX_GetLightDescription +Description: + Get the description of a light attached to a device +Inputs: Accepts an index to the device and an index to the light +Outputs: Populates a character string with the light's description +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided. + LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided. + LFX_ERROR_BUFFSIZE if the buffer provided is too small in size. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightDescription(const unsigned int, const unsigned int, char* const, const unsigned int); + +/********************************************************* +Function: LFX_GetLightLocation +Description: + Get the location of a light attached to a device +Inputs: Accepts an index to the device and an index to the light +Outputs: Populates a LFX_POSITION structure with the light's position (see LFXDecl.h + for more information). +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided. + LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided. + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightLocation(const unsigned int, const unsigned int, PLFX_POSITION const); + +/********************************************************* +Function: LFX_GetLightColor +Description: + Get the current color of a light attached to a device +Important: + This function provides the current color stored in the active state + since the last LFX_Reset() call, it does not necessarily reflect the color of the + physical light. To ensure that the returned value represents the state of the + physical light, call LFX_GetLightColor immediately after a call to LFX_Update() and + before the next call to LFX_Reset(). +Inputs: Accepts an index to the device and an index to the light +Outputs: Populates a LFX_COLOR structure with the light's description +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NODEVS if the system is initialized but no devices are available at the index provided. + LFX_ERROR_NOLIGHTS if no lights are available at the device and light index provided. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetLightColor(const unsigned int, const unsigned int, PLFX_COLOR const); + +/********************************************************* +Function: LFX_SetLightColor +Description: + Sets the current color of a light attached to a device +Important: + This function changes the current color stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. +Inputs: Accepts an index to the device, an index to the light, and a new LFX_COLOR value +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightColor(const unsigned int, const unsigned int, const PLFX_COLOR); + +/********************************************************* +Function: LFX_Light +Description: + Sets the color of a location for any devices with lights in that + corresponding location. +Important: + This function changes the current color stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. +Location Mask Note: + Location mask is a 32-bit field, where each of the first 27 bits represent + a zone in the virtual cube representing the system (see LFXDecl.h) +Color Packing Note: + Color is packed into a 32-bit value, as follows: + Bits 0-7: Blue + Bits 8-15: Green + Bits 16-23: Red + Bits 24-32: Brightness +Inputs: Accepts a 32-bit location mask and a packed color value +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified. + LFX_FAILURE if some other error occurred + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_Light(const unsigned int, const unsigned int); + +/********************************************************* +Function: LFX_SetLightActionColor +Description: + Sets the primary color and an action type to a light +Important: + This function changes the current color and action type stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. If the action type is a morph, then + the secondary color for the action is black. +Inputs: Accepts an index to the device, an index to the light, an action type, and a new primary LFX_COLOR value +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColor(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR); + +/********************************************************* +Function: LFX_SetLightActionColorEx +Description: + Sets the primary and secondary colors and an action type to a light +Important: + This function changes the current color and action type stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. If the action type is not a morph, + then the secondary color is ignored. +Inputs: Accepts an index to the device, an index to the light, an action type, and two LFX_COLOR values +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_SetLightActionColorEx(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR, const PLFX_COLOR); + +/********************************************************* +Function: LFX_ActionColor +Description: + Sets the primary color and an action type for any devices with lights in a location. +Important: + This function changes the current primary color and action type stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. If the action type is a morph, then + the secondary color for the action is black. +Location Mask Note: + Location mask is a 32-bit field, where each of the first 27 bits represent + a zone in the virtual cube representing the system (see LFXDecl.h) +Color Packing Note: + Color is packed into a 32-bit value, as follows: + Bits 0-7: Blue + Bits 8-15: Green + Bits 16-23: Red + Bits 24-32: Brightness +Inputs: Accepts a 32-bit location mask and a packed color value +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified. + LFX_FAILURE if some other error occurred + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColor(const unsigned int, const unsigned int, const unsigned int); + +/********************************************************* +Function: LFX_ActionColorEx +Description: + Sets the primary and secondary color and an action type for any devices with lights in a location. +Important: + This function changes the current primary and secondary color and action type stored in the active state + since the last LFX_Reset() call. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. If the action type is not a morph, + then the secondary color is ignored. +Location Mask Note: + Location mask is a 32-bit field, where each of the first 27 bits represent + a zone in the virtual cube representing the system (see LFXDecl.h) +Color Packing Note: + Color is packed into a 32-bit value, as follows: + Bits 0-7: Blue + Bits 8-15: Green + Bits 16-23: Red + Bits 24-32: Brightness +Inputs: Accepts a 32-bit location mask and a packed color value +Outputs: None +Returns: + LFX_ERROR_NOINIT if the system is not yet initialized. + LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified. + LFX_FAILURE if some other error occurred + LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_ActionColorEx(const unsigned int, const unsigned int, const unsigned int, const unsigned int); + +/********************************************************* +Function: LFX_SetTiming +Description: + Sets the tempo for actions. +Important: + This function changes the current tempo or timing to be used for the + next actions. It does NOT immediately update the physical light + settings, until a call to LFX_Update() is made. +Timing Note: + Is a value between min and max tempo allowed for the main device. + If a value lower than min or a value greather than max is entered, + the value is readjusted to those extremes. +Inputs: Accepts a 32-bit timing value +Outputs: None +Returns: + LFX_FAILURE if changing tempo is not supported or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_SetTiming(const int); + +/********************************************************* +Function: LFX_GetVersion +Description: + Get API Version +Inputs: Accepts the buffer and buffer size +Outputs: + Populates a character string with the API version +Returns: + LFX_ERROR_BUFFSIZE if the buffer provided is too small. + LFX_FAILURE or LFX_SUCCESS otherwise. +*********************************************************/ +FN_DECLSPEC LFX_RESULT STDCALL LFX_GetVersion(char* const, const unsigned int); + +#ifdef __cplusplus +} /* end extern "C" */ +#endif + +// The remaining defines and typedefs are useful for explicitly linking to +// the DLL, and can be ignored if using the static lib, or implicitely linking. +#define LFX_DLL_NAME "LightFX.dll" + +// LightFX 2.0 DLL export function names +#define LFX_DLL_INITIALIZE "LFX_Initialize" +#define LFX_DLL_RELEASE "LFX_Release" +#define LFX_DLL_RESET "LFX_Reset" +#define LFX_DLL_UPDATE "LFX_Update" +#define LFX_DLL_UPDATEDEFAULT "LFX_UpdateDefault" +#define LFX_DLL_GETNUMDEVICES "LFX_GetNumDevices" +#define LFX_DLL_GETDEVDESC "LFX_GetDeviceDescription" +#define LFX_DLL_GETNUMLIGHTS "LFX_GetNumLights" +#define LFX_DLL_GETLIGHTDESC "LFX_GetLightDescription" +#define LFX_DLL_GETLIGHTLOC "LFX_GetLightLocation" +#define LFX_DLL_GETLIGHTCOL "LFX_GetLightColor" +#define LFX_DLL_SETLIGHTCOL "LFX_SetLightColor" +#define LFX_DLL_LIGHT "LFX_Light" +#define LFX_DLL_SETLIGHTACTIONCOLOR "LFX_SetLightActionColor" +#define LFX_DLL_SETLIGHTACTIONCOLOREX "LFX_SetLightActionColorEx" +#define LFX_DLL_ACTIONCOLOR "LFX_ActionColor" +#define LFX_DLL_ACTIONCOLOREX "LFX_ActionColorEx" +#define LFX_DLL_SETTIMING "LFX_SetTiming" +#define LFX_DLL_GETVERSION "LFX_GetVersion" + +// LightFX 2.0 function pointer declarations +typedef LFX_RESULT (*LFX2INITIALIZE)(); +typedef LFX_RESULT (*LFX2RELEASE)(); +typedef LFX_RESULT (*LFX2RESET)(); +typedef LFX_RESULT (*LFX2UPDATE)(); +typedef LFX_RESULT (*LFX2UPDATEDEFAULT)(); +typedef LFX_RESULT (*LFX2GETNUMDEVICES)(unsigned int* const); +typedef LFX_RESULT (*LFX2GETDEVDESC)(const unsigned int, char* const, const unsigned int, unsigned char* const); +typedef LFX_RESULT (*LFX2GETNUMLIGHTS)(const unsigned int, unsigned int* const); +typedef LFX_RESULT (*LFX2GETLIGHTDESC)(const unsigned int, const unsigned int, char* const, const unsigned int); +typedef LFX_RESULT (*LFX2GETLIGHTLOC)(const unsigned int, const unsigned int, PLFX_POSITION const); +typedef LFX_RESULT (*LFX2GETLIGHTCOL)(const unsigned int, const unsigned int, PLFX_COLOR const); +typedef LFX_RESULT (*LFX2SETLIGHTCOL)(const unsigned int, const unsigned int, const PLFX_COLOR); +typedef LFX_RESULT (*LFX2LIGHT)(const unsigned int, const unsigned int); +typedef LFX_RESULT (*LFX2SETLIGHTACTIONCOLOR)(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR); +typedef LFX_RESULT (*LFX2SETLIGHTACTIONCOLOREX)(const unsigned int, const unsigned int, const unsigned int, const PLFX_COLOR, const PLFX_COLOR); +typedef LFX_RESULT (*LFX2ACTIONCOLOR)(const unsigned int, const unsigned int, const unsigned int); +typedef LFX_RESULT (*LFX2ACTIONCOLOREX)(const unsigned int, const unsigned int, const unsigned int, const unsigned int); +typedef LFX_RESULT (*LFX2SETTIMING)(const int); +typedef LFX_RESULT (*LFX2GETVERSION)(char* const, const unsigned int); \ No newline at end of file diff --git a/UniLight/LFXDecl.h b/UniLight/cots/dell/LFXDecl.h similarity index 100% rename from UniLight/LFXDecl.h rename to UniLight/cots/dell/LFXDecl.h diff --git a/UniLight/cots/logitech/LogitechLEDLib.h b/UniLight/cots/logitech/LogitechLEDLib.h new file mode 100644 index 0000000..a7b0643 --- /dev/null +++ b/UniLight/cots/logitech/LogitechLEDLib.h @@ -0,0 +1,188 @@ +// +// Logitech Gaming LED SDK +// +// Copyright (C) 2011-2014 Logitech. All rights reserved. +// Author: Tiziano Pigliucci +// Email: devtechsupport@logitech.com + +#pragma once + +#define LOGI_LED_BITMAP_WIDTH 21 +#define LOGI_LED_BITMAP_HEIGHT 6 +#define LOGI_LED_BITMAP_BYTES_PER_KEY 4 + +#define LOGI_LED_BITMAP_SIZE (LOGI_LED_BITMAP_WIDTH*LOGI_LED_BITMAP_HEIGHT*LOGI_LED_BITMAP_BYTES_PER_KEY) + +#define LOGI_LED_DURATION_INFINITE 0 + +#define LOGI_DEVICETYPE_MONOCHROME_ORD 0 +#define LOGI_DEVICETYPE_RGB_ORD 1 +#define LOGI_DEVICETYPE_PERKEY_RGB_ORD 2 + +#define LOGI_DEVICETYPE_MONOCHROME (1 << LOGI_DEVICETYPE_MONOCHROME_ORD) +#define LOGI_DEVICETYPE_RGB (1 << LOGI_DEVICETYPE_RGB_ORD) +#define LOGI_DEVICETYPE_PERKEY_RGB (1 << LOGI_DEVICETYPE_PERKEY_RGB_ORD) + +#define LOGI_DEVICETYPE_ALL (LOGI_DEVICETYPE_MONOCHROME | LOGI_DEVICETYPE_RGB | LOGI_DEVICETYPE_PERKEY_RGB) + + +namespace LogiLed +{ + typedef enum + { + ESC = 0x01, + F1 = 0x3b, + F2 = 0x3c, + F3 = 0x3d, + F4 = 0x3e, + F5 = 0x3f, + F6 = 0x40, + F7 = 0x41, + F8 = 0x42, + F9 = 0x43, + F10 = 0x44, + F11 = 0x57, + F12 = 0x58, + PRINT_SCREEN = 0x137, + SCROLL_LOCK = 0x46, + PAUSE_BREAK = 0x145, + TILDE = 0x29, + ONE = 0x02, + TWO = 0x03, + THREE = 0x04, + FOUR = 0x05, + FIVE = 0x06, + SIX = 0x07, + SEVEN = 0x08, + EIGHT = 0x09, + NINE = 0x0A, + ZERO = 0x0B, + MINUS = 0x0C, + EQUALS = 0x0D, + BACKSPACE = 0x0E, + INSERT = 0x152, + HOME = 0x147, + PAGE_UP = 0x149, + NUM_LOCK = 0x45, + NUM_SLASH = 0x135, + NUM_ASTERISK = 0x37, + NUM_MINUS = 0x4A, + TAB = 0x0F, + Q = 0x10, + W = 0x11, + E = 0x12, + R = 0x13, + T = 0x14, + Y = 0x15, + U = 0x16, + I = 0x17, + O = 0x18, + P = 0x19, + OPEN_BRACKET = 0x1A, + CLOSE_BRACKET = 0x1B, + BACKSLASH = 0x2B, + KEYBOARD_DELETE = 0x153, + END = 0x14F, + PAGE_DOWN = 0x151, + NUM_SEVEN = 0x47, + NUM_EIGHT = 0x48, + NUM_NINE = 0x49, + NUM_PLUS = 0x4E, + CAPS_LOCK = 0x3A, + A = 0x1E, + S = 0x1F, + D = 0x20, + F = 0x21, + G = 0x22, + H = 0x23, + J = 0x24, + K = 0x25, + L = 0x26, + SEMICOLON = 0x27, + APOSTROPHE = 0x28, + ENTER = 0x1C, + NUM_FOUR = 0x4B, + NUM_FIVE = 0x4C, + NUM_SIX = 0x4D, + LEFT_SHIFT = 0x2A, + Z = 0x2C, + X = 0x2D, + C = 0x2E, + V = 0x2F, + B = 0x30, + N = 0x31, + M = 0x32, + COMMA = 0x33, + PERIOD = 0x34, + FORWARD_SLASH = 0x35, + RIGHT_SHIFT = 0x36, + ARROW_UP = 0x148, + NUM_ONE = 0x4F, + NUM_TWO = 0x50, + NUM_THREE = 0x51, + NUM_ENTER = 0x11C, + LEFT_CONTROL = 0x1D, + LEFT_WINDOWS = 0x15B, + LEFT_ALT = 0x38, + SPACE = 0x39, + RIGHT_ALT = 0x138, + RIGHT_WINDOWS = 0x15C, + APPLICATION_SELECT = 0x15D, + RIGHT_CONTROL = 0x11D, + ARROW_LEFT = 0x14B, + ARROW_DOWN = 0x150, + ARROW_RIGHT = 0x14D, + NUM_ZERO = 0x52, + NUM_PERIOD = 0x53, + G_1 = 0xFFF1, + G_2 = 0xFFF2, + G_3 = 0xFFF3, + G_4 = 0xFFF4, + G_5 = 0xFFF5, + G_6 = 0xFFF6, + G_7 = 0xFFF7, + G_8 = 0xFFF8, + G_9 = 0xFFF9, + G_LOGO = 0xFFFF1, + G_BADGE = 0xFFFF2 + + }KeyName; +} + +bool LogiLedInit(); + +bool LogiLedGetSdkVersion(int *majorNum, int *minorNum, int *buildNum); +bool LogiLedGetConfigOptionNumber(const wchar_t *configPath, double *defaultValue); +bool LogiLedGetConfigOptionBool(const wchar_t *configPath, bool *defaultValue); +bool LogiLedGetConfigOptionColor(const wchar_t *configPath, int *defaultRed, int *defaultGreen, int *defaultBlue); +bool LogiLedGetConfigOptionKeyInput(const wchar_t *configPath, wchar_t *defaultValue, int bufferSize); +bool LogiLedSetConfigOptionLabel(const wchar_t *configPath, wchar_t *label); + +//Generic functions => Apply to any device type. +bool LogiLedSetTargetDevice(int targetDevice); +bool LogiLedSaveCurrentLighting(); +bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage); +bool LogiLedRestoreLighting(); +bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); +bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval); +bool LogiLedStopEffects(); + +//Per-key functions => only apply to LOGI_DEVICETYPE_PERKEY_RGB devices. +bool LogiLedSetLightingFromBitmap(unsigned char bitmap[]); +bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); +bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); +bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage); +bool LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage); +bool LogiLedSaveLightingForKey(LogiLed::KeyName keyName); +bool LogiLedRestoreLightingForKey(LogiLed::KeyName keyName); +bool LogiLedExcludeKeysFromBitmap(LogiLed::KeyName *keyList, int listCount); + +//Per-key effects => only apply to LOGI_DEVICETYPE_PERKEY_RGB devices. +bool LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval); +bool LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite); +bool LogiLedStopEffectsOnKey(LogiLed::KeyName keyName); + +void LogiLedShutdown(); + + + diff --git a/UniLight/razer/ChromaAppInfo.xml b/UniLight/cots/razer/ChromaAppInfo.xml similarity index 100% rename from UniLight/razer/ChromaAppInfo.xml rename to UniLight/cots/razer/ChromaAppInfo.xml diff --git a/UniLight/razer/RzChromaSDKDefines.h b/UniLight/cots/razer/RzChromaSDKDefines.h similarity index 100% rename from UniLight/razer/RzChromaSDKDefines.h rename to UniLight/cots/razer/RzChromaSDKDefines.h diff --git a/UniLight/razer/RzChromaSDKTypes.h b/UniLight/cots/razer/RzChromaSDKTypes.h similarity index 100% rename from UniLight/razer/RzChromaSDKTypes.h rename to UniLight/cots/razer/RzChromaSDKTypes.h diff --git a/UniLight/razer/RzErrors.h b/UniLight/cots/razer/RzErrors.h similarity index 100% rename from UniLight/razer/RzErrors.h rename to UniLight/cots/razer/RzErrors.h diff --git a/UniLight/resource.h b/UniLight/resource.h index 6aae974d270e88fa548879a10870b6df6cd5ad71..10f2627b57c8f391bc81e05c8e240600a663995d 100644 GIT binary patch literal 440 zcmZvYO>ToQ5QX=gVkDN40;s(J#a^I-9r34TWjQcVSJYHs`lBc(>!L^M6>1hVN|f1* z^yZtVH}m`b<9Wv;>(D(tv;RS0mEtun~)>07e@}eX$7cr~&BPENjF9sP631`V(6&dV&Kq6(9eu9*V=?gkt2Gz}TKMB(1|ZT|JXv$H+2$ar!^2e)Ax QkX{=DERS(fH>zFRA41iC@c;k- literal 912 zcmb7?-%i3%4934}6W?LUE=@q9FEBSQh%k*~M6VW@3};Xb1OLSM>gumMsA!OAn(nkc zJzu}JdwXrFsb?hCi84iM>lBS^D^{ouUZNLdS3Bf3<*BDqx#pUwLJKX34Tx1*YN#n* zs6E8fL}T5ebK(omOJXIFoUA3@7{4Gg#cHfoNWpU1BR!Fm@}^W5o#+ar28j7*zA^K4 zS67+nhFTuHtjf5~araiuY8fAoz9KY3LpqPuBDP6d+UL#?zWR?rc&xj2m_vG**8Y9n z|C0L(v;r1$POJF9Inzkj*g3h?8lK}o z{^pF_fNblps|!#PzC9fg>0)o1OSY<=@usbFIAk)Mgf}Txh@HVC03pTxIWwEr!Jm(vZX5op?~i?M;_Wuuhqd*)jkO2r|FGR8Z5P{dZ9ZTBkk9sQW41Xr H{qO!e4cdTj From 8e9aa9dd733bb39038128fbb0343182fe808a9c0 Mon Sep 17 00:00:00 2001 From: HunterZ <> Date: Mon, 29 Oct 2018 23:37:58 -0700 Subject: [PATCH 3/3] Update readme --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ee354f9..dc6ebc8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # UniLight -Synchronize Corsair CUE, Dell/Alienware LightFX/AlienFX, and/or Logitech Gaming LED devices with Windows accent/colorization color +Synchronize Corsair CUE, Dell/Alienware LightFX/AlienFX, Logitech LED, and/or Razer Chroma devices with Windows accent/colorization color ## Demo https://youtu.be/I3xfJtbLqgA @@ -10,21 +10,21 @@ I have an Alienware 17R3 laptop and have been using AlienFX WinTheme to sync the ## Usage Simply launch UniLight and forget about it. Configure Windows to launch it at startup if you want. -UniLight appears as a system tray icon that looks like a color wheel, and listens for changes to accent color or other conditions that may affect LED color synchronization. On startup and whenever any relevant changes are detected, it calls the LightFX/AlienFX and Logitech Gaming LED APIs to set all RGB LEDs to the current accent color. +UniLight appears as a system tray icon that looks like a color wheel, and listens for changes to accent color or other conditions that may affect LED color synchronization. On startup and whenever any relevant changes are detected, it calls the various APIs to set all RGB LEDs to the current accent color. -Hovering the mouse cursor over the UniLight tray icon will produce a tooltip containing status information, including the current and last accent colors, and whether they were successfully applied to Alienware and/or Logitech devices. +Hovering the mouse cursor over the UniLight tray icon will produce a tooltip containing status information, including the current and last accent colors, and whether they were successfully applied to each of the vendor APIs. Right-clicking the tray icon will bring up a context menu with self-explanatory selections, while left-clicking performs a manual color synchronization. ## Troubleshooting -UniLight comes with DLLs for the various supported APIs. These are mainly included so that users without software from one or more of the supported vendors can still use UniLight. If you have trouble with the included DLLs, it's highly recommended that you try deleting/renaming the included DLLs for which you may have system-level counterparts installed. +UniLight may comes with a Corsair CUE DLL because they make me link a loader library into UniLight that prevents it from working at all when the DLL is not present. If you are a Corsair CUE user and have issues, you may want to try renaming/deleting the included DLL to ensure that the one included with your driver version is used instead. -Dell/Alienware LightFX/AlienFX DLLs are not included, because the fact that that SDK requires that I manually load the DLL anyway means that I can just disable support if the DLL is not available at the OS level. +DLLs for the other APIs are not included. UniLight simply skips over any APIs for which it fails to load/initialize a DLL. ## System Requirements -I'm not 100% sure about these. I tried to implement the API access in such a way that it will fail gracefully if a hardware vendor API is not supported on your system. UniLight will also attempt to re-apply the color on every color change, so that there is some hope of avoiding having to restart UniLight if relevant peripherals are (re)connected after UniLight has already been launched. I haven't tried to make it any more aggressive because I have to poll both APIs (neither provides a notification callback mechanism) and I don't want UniLight to have a noticeable performance impact on gaming or other tasks. +I'm not 100% sure about these. I tried to implement the API access in such a way that it will fail gracefully if a hardware vendor API is not supported on your system. UniLight will also attempt to re-apply the color on every color change, so that there is some hope of avoiding having to restart UniLight if relevant peripherals are (re)connected after UniLight has already been launched. I haven't tried to make it any more aggressive because I have to poll all APIs (none provide a notification callback mechanism) and I don't want UniLight to have a noticeable performance impact on gaming or other tasks. -UniLight should load the AlienFX and/or Logitech Gaming LED DLLs that you have installed as part of Alienware Command Center (minimum version unknown; I'm currently on 4.5.19) and Logitech Gaming Software (version 8.55 or higher required for LED support), respectively. Also, the binary distribution of this program is 32-bit for maximum compatibility (I'm running it on 64-bit systems, so I know it works there). +UniLight should load the AlienFX, Logitech Gaming LED, and/or Razer Chroma DLLs that you have installed as part of Alienware Command Center (minimum version unknown; I'm currently on 4.5.19), Logitech Gaming Software (version 8.55 or higher required for LED support), and/or Razer Synapse (tested with 3.3.1018.10194 / Chroma SDK 2.21.1), respectively. Also, the binary distribution of this program is 32-bit for maximum compatibility (I'm running it on 64-bit systems, so I know it works there). As of version 1.1, UniLight is completely event-driven and no longer polls the Windows accent color on a timer. The result should be extremely minimal CPU usage. @@ -34,8 +34,9 @@ This project was created with: * Alienware AlienFX 1.0 SDK (formerly Dell LightFX): http://www.dell.com/support/home/us/en/19/drivers/driversdetails?driverId=T5GGP * Corsair CUE SDK (Protocol version 4): http://forum.corsair.com/v3/showthread.php?t=156813 * Logitech LED Illumination SDK: https://www.logitechg.com/en-us/developers +* Razer Chrome SDK: https://developer.razer.com/ ## License All code contained in this repository and binaries built from it are covered by the MIT open source license. See the LICENSE file for details. Usage of this code must be attributed to GitHub user HunterZ. -Included DLLs are owned by the hardware vendor companies (Corsair, Dell/Alienware, Logitech). +Included DLLs are owned by the hardware vendor companies (Corsair, Dell/Alienware, Logitech, Razer). I assert no rights or support responsibilities for these.