From 8beeb5f7b26ea81060ed53bac02fed7f880a5302 Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Tue, 17 Dec 2019 14:27:06 -0600 Subject: [PATCH] Get Qt project building on Windows, remove Visual Studio files --- OpenAuraSDK.cpp | 1 - OpenAuraSDK.sln | 31 ----- OpenAuraSDK.vcxproj | 254 ------------------------------------ OpenAuraSDK.vcxproj.filters | 236 --------------------------------- OpenAuraSDK_Win.pro | 100 ++++++++++++++ README.md | 53 ++++---- main.cpp | 25 +--- vc/I2CDetectDialog.cpp | 50 ------- vc/I2CDetectDialog.h | 28 ---- vc/OpenAuraSDKDialog.cpp | 197 ---------------------------- vc/OpenAuraSDKDialog.h | 38 ------ vc/Resource.rc | Bin 8678 -> 0 bytes vc/resource.h | 61 --------- 13 files changed, 135 insertions(+), 939 deletions(-) delete mode 100644 OpenAuraSDK.sln delete mode 100644 OpenAuraSDK.vcxproj delete mode 100644 OpenAuraSDK.vcxproj.filters create mode 100644 OpenAuraSDK_Win.pro delete mode 100644 vc/I2CDetectDialog.cpp delete mode 100644 vc/I2CDetectDialog.h delete mode 100644 vc/OpenAuraSDKDialog.cpp delete mode 100644 vc/OpenAuraSDKDialog.h delete mode 100644 vc/Resource.rc delete mode 100644 vc/resource.h diff --git a/OpenAuraSDK.cpp b/OpenAuraSDK.cpp index 74083fd6..282f1f63 100644 --- a/OpenAuraSDK.cpp +++ b/OpenAuraSDK.cpp @@ -16,7 +16,6 @@ #ifdef WIN32 -#include #include #include "i2c_smbus_piix4.h" #include "i2c_smbus_i801.h" diff --git a/OpenAuraSDK.sln b/OpenAuraSDK.sln deleted file mode 100644 index b94bf34b..00000000 --- a/OpenAuraSDK.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.452 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenAuraSDK", "OpenAuraSDK.vcxproj", "{6D22BFF3-C1DF-407A-8816-05D63919A991}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x64.ActiveCfg = Debug|x64 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x64.Build.0 = Debug|x64 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x86.ActiveCfg = Debug|Win32 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Debug|x86.Build.0 = Debug|Win32 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x64.ActiveCfg = Release|x64 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x64.Build.0 = Release|x64 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x86.ActiveCfg = Release|Win32 - {6D22BFF3-C1DF-407A-8816-05D63919A991}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A2BB3E13-D506-413D-900E-F2B1323B3BB3} - EndGlobalSection -EndGlobal diff --git a/OpenAuraSDK.vcxproj b/OpenAuraSDK.vcxproj deleted file mode 100644 index 1adca320..00000000 --- a/OpenAuraSDK.vcxproj +++ /dev/null @@ -1,254 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {6D22BFF3-C1DF-407A-8816-05D63919A991} - Win32Proj - OpenAuraSDK - 10.0 - - - - Application - true - v142 - Unicode - Dynamic - - - Application - false - v142 - true - Unicode - Dynamic - - - Application - true - v142 - Unicode - Dynamic - - - Application - false - v142 - true - Unicode - Dynamic - - - - - - - - - - - - - - - - - - - - - true - .exe - - - true - .exe - - - false - .exe - - - false - .exe - - - - NotUsing - Level3 - Disabled - true - WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN - true - .\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\Controllers\RGBFusionController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories) - true - - - MultiThreadedDLL - - - Windows - true - .\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories) - - - - - NotUsing - Level3 - Disabled - true - WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN - true - - - .\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\Controllers\RGBFusionController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories) - MultiThreadedDLL - true - - - Windows - true - .\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories) - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN - true - .\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\Controllers\RGBFusionController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories) - true - - - MultiThreadedDLL - - - Windows - true - true - true - .\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories) - - - - - NotUsing - Level3 - MaxSpeed - true - true - true - WIN32;_CRT_SECURE_NO_WARNINGS;_AFXDLL;_WINSOCK_DEPRECATED_NO_WARNINGS;WIN32_LEAN_AND_MEAN - true - - - .\dependencies\inpout32_1501\Win32;.\dependencies\razer-chroma-2.9.0\inc;.\Controllers\AuraController;.\Controllers\CorsairController;.\Controllers\CorsairProController;.\Controllers\HuePlusController;.\Controllers\HyperXController;.\Controllers\LEDStripController;.\Controllers\RGBFusionController;.\RGBController;.\i2c_smbus;.\net_port;.\serial_port;.\vc;.\wmi;.\;%(AdditionalIncludeDirectories) - MultiThreadedDLL - true - - - Windows - true - true - true - .\dependencies\inpout32_1501\Win32;%(AdditionalLibraryDirectories) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenAuraSDK.vcxproj.filters b/OpenAuraSDK.vcxproj.filters deleted file mode 100644 index 96ba3a2c..00000000 --- a/OpenAuraSDK.vcxproj.filters +++ /dev/null @@ -1,236 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {192d5e34-581a-40c4-bc69-f4b61632fd81} - - - {d64d74dd-f822-4617-a88c-00dca03f70d9} - - - {ee7c811d-9bd1-43a8-9d42-62801332ab30} - - - {fa28cfae-d8a7-4194-8f25-e35827dd0145} - - - {a50a158e-81a1-45c3-a300-67e869afcc2f} - - - {8eae9b90-7558-4b0b-9f03-d3a651cb6624} - - - {02dd848e-6106-4f74-a58c-4a7547498ac3} - - - - - Source Files\Application - - - Source Files\Application - - - Source Files - - - Source Files - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\i2c_smbus - - - Source Files\i2c_smbus - - - Source Files\i2c_smbus - - - Source Files\i2c_smbus - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\Application - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\Application - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\RGBController - - - Source Files\Controllers - - - Source Files\Controllers - - - Source Files\RGBController - - - - - Resource Files - - - - - Header Files - - - Header Files - - - Header Files\Controllers - - - Header Files\Controllers - - - Header Files\Controllers - - - Header Files\Controllers - - - Header Files\Controllers - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\i2c_smbus - - - Header Files\i2c_smbus - - - Header Files\i2c_smbus - - - Header Files\i2c_smbus - - - Header Files - - - Header Files - - - Header Files - - - Resource Files - - - Header Files\Controllers - - - Header Files - - - Header Files\RGBController - - - Header Files\RGBController - - - Header Files\Controllers - - - Header Files\RGBController - - - \ No newline at end of file diff --git a/OpenAuraSDK_Win.pro b/OpenAuraSDK_Win.pro new file mode 100644 index 00000000..9b2b8bec --- /dev/null +++ b/OpenAuraSDK_Win.pro @@ -0,0 +1,100 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = OpenAuraSDK +TEMPLATE = app + +LIBS += \ + -lws2_32 \ + -L"$$PWD/dependencies/inpout32_1501/Win32/" -linpout32 + +DEFINES -= \ + UNICODE + +DEFINES += \ + _MBCS \ + WIN32 \ + _CRT_SECURE_NO_WARNINGS \ + _WINSOCK_DEPRECATED_NO_WARNINGS \ + WIN32_LEAN_AND_MEAN + +INCLUDEPATH += \ + dependencies/inpout32_1501/Win32/ \ + dependencies/razer-chroma-2.9.0/inc \ + i2c_smbus/ \ + net_port/ \ + serial_port/ \ + wmi/ \ + Controllers/AuraController/ \ + Controllers/CorsairController/ \ + Controllers/CorsairProController/ \ + Controllers/HuePlusController/ \ + Controllers/HyperXController/ \ + Controllers/LEDStripController/ \ + Controllers/RGBFusionController/ \ + RGBController/ \ + qt/ + +SOURCES += \ + main.cpp \ + OpenAuraSDK.cpp \ + qt/OpenAuraSDKQtDialog.cpp \ + i2c_smbus/i2c_smbus.cpp \ + i2c_smbus/i2c_smbus_i801.cpp \ + i2c_smbus/i2c_smbus_nct6775.cpp \ + i2c_smbus/i2c_smbus_piix4.cpp \ + net_port/net_port.cpp \ + serial_port/serial_port.cpp \ + wmi/wmi.cpp \ + Controllers/AuraController/AuraController.cpp \ + Controllers/AuraController/AuraControllerDetect.cpp \ + Controllers/CorsairController/CorsairController.cpp \ + Controllers/CorsairController/CorsairControllerDetect.cpp \ + Controllers/CorsairProController/CorsairProController.cpp \ + Controllers/CorsairProController/CorsairProControllerDetect.cpp \ + Controllers/HuePlusController/HuePlusController.cpp \ + Controllers/HuePlusController/HuePlusControllerDetect.cpp \ + Controllers/HyperXController/HyperXController.cpp \ + Controllers/HyperXController/HyperXControllerDetect.cpp \ + Controllers/LEDStripController/LEDStripController.cpp \ + Controllers/LEDStripController/LEDStripControllerDetect.cpp \ + Controllers/RGBFusionController/RGBFusionController.cpp \ + Controllers/RGBFusionController/RGBFusionControllerDetect.cpp \ + RGBController/RazerChromaSDKDetect.cpp \ + RGBController/RGBController_Aura.cpp \ + RGBController/RGBController_Corsair.cpp \ + RGBController/RGBController_CorsairPro.cpp \ + RGBController/RGBController_HuePlus.cpp \ + RGBController/RGBController_HyperX.cpp \ + RGBController/RGBController_LEDStrip.cpp \ + RGBController/RGBController_RazerChromaSDK.cpp \ + RGBController/RGBController_RGBFusion.cpp + +HEADERS += \ + dependencies/inpout32_1501/Win32/inpout32.h \ + qt/OpenAuraSDKQtDialog.h \ + i2c_smbus/i2c_smbus.h \ + i2c_smbus/i2c_smbus_i801.h \ + i2c_smbus/i2c_smbus_nct6775.h \ + i2c_smbus/i2c_smbus_piix4.h \ + net_port/net_port.h \ + serial_port/serial_port.h \ + wmi/wmi.h \ + Controllers/AuraController/AuraController.h \ + Controllers/CorsairController/CorsairController.h \ + Controllers/CorsairProController/CorsairProController.h \ + Controllers/HuePlusController/HuePlusController.h \ + Controllers/HyperXController/HyperXController.h \ + Controllers/LEDStripController/LEDStripController.h \ + RGBController/RGBController.h \ + RGBController/RGBController_Aura.h \ + RGBController/RGBController_Corsair.h \ + RGBController/RGBController_CorsairPro.h \ + RGBController/RGBController_HuePlus.h \ + RGBController/RGBController_HyperX.h \ + RGBController/RGBController_RazerChromaSDK.h \ + RGBController/RGBController_RGBFusion.h + +FORMS += \ + qt/openaurasdk.ui diff --git a/README.md b/README.md index e54968e1..aea24c4d 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,39 @@ -# OpenAuraSDK -##### This project is an open-source implementation of the Asus Aura RGB controller software. It currently only supports a limited number of motherboard and RAM module lighting controllers. +# OpenRGB (formerly OpenAuraSDK) -## Supported Devices +The goal of this project is to create an easy-to-use open source software program and library for accessing and controlling RGB lights on various PC hardware including motherboards, RAM modules, graphics cards, cooling devices, and peripherals. -Confirmed supported motherboards: - - ASUS PRIME X370 Pro - - ASUS PRIME X470 Pro - - ASUS PRIME Z270-A - - ASUS PRIME Z370-A - - ASUS ROG Strix Z370-E - -Confirmed supported RGB RAM (except on X299): - - G.Skill Trident Z RGB - - Geil Super Luce - - TeamGroup Delta RGB +This project originally focused only on ASUS Aura. It was spun off of Keyboard Visualizer's AsusAuraWindows branch to learn more about the details behind the Aura protocol and to develop a more flexible, compatible, and reliable driver for Aura. Our Aura implementation is now quite solid and supports multiple generations of Aura controller across both Intel and AMD platforms. It also supports Aura-compatible controllers used across multiple manufacturers of RGB memory modules including G.Skill Trident Z RGB and others. It is still lacking a few capabilities, namely saving settings to persist across reboots, but the core functionality of setting colors and modes is there. -Experimental support in generic RGB testing branch: - - Corsair Vengeance RGB - - Corsair Vengeance Pro RGB - - HyperX Predator RGB +After getting a solid Aura implementation, the project branched out into other manufacturers and categories of RGB devices. A major focus was to develop a software API that could reliably represent as many RGB devices as possible, exposing their various modes and describing their LED layouts via zones, that was generic enough to write a user application without specifically targeting any one manufacturer. To this extent, the generic_rgb_interface_test branch was created which became the foundation of OpenRGB. The goal of OpenRGB is to both develop new drivers for unsupported devices and integrate existing open source drivers for devices that do have some sort of open support. The goal is to be the one-stop solution to open source RGB lighting control! + +## Supported Devices + +* Asus Aura (SMBus variants only) + +* Gigabyte RGB Fusion 1.0 + +* Asus Aura RAM + +* Corsair Vengeance RGB + +* Corsair Vengeance Pro RGB + +* HyperX Predator RGB + +* NZXT Hue+ + +* KeyboardVisualizer Arduino LED Strips + +* E1.31 (Linux only) + +* OpenRazer (Linux only) ## Installation #### Windows - 1. Download the latest Visual Studio Community Edition and open the `.sln`. - 2. Build the project for `x86` Architecture. The InpOut32 library I use does not support x64. - 3. Copy InpOut32.dll from dependencies to the same path as OpenAuraSDK.exe. - -**You may have to retarget the project to the latest version of the Windows SDK and build tools and stuff.** + 1. Download the latest Visual Studio Community Edition and Qt Creator. + 2. Open the OpenRGB_Win.pro project. + 3. Build the project for `x86` Architecture. The InpOut32 library I use does not support x64. + 4. Copy InpOut32.dll from dependencies to the same path as OpenAuraSDK.exe along with the Qt libraries. **You must run the application as Administrator the first time to allow InpOut32 to set up. It can be run as a normal user afterwards** diff --git a/main.cpp b/main.cpp index 39e6c6a3..da220901 100644 --- a/main.cpp +++ b/main.cpp @@ -13,15 +13,8 @@ #include #include -#ifdef WIN32 - -#include "OpenAuraSDKDialog.h" - -#else /* WIN32 */ - #include "OpenAuraSDKQtDialog.h" -#endif /* WIN32 */ extern std::vector busses; extern std::vector rgb_controllers; @@ -38,20 +31,12 @@ int main(int argc, char* argv[]) { DetectRGBControllers(); -#if WIN32 - OpenAuraSDKDialog dlg(busses, rgb_controllers); - dlg.DoModal(); - - return 0; - -#else QApplication a(argc, argv); Ui::OpenAuraSDKQtDialog dlg(busses, rgb_controllers); dlg.show(); return a.exec(); -#endif } /******************************************************************************************\ @@ -63,8 +48,8 @@ int main(int argc, char* argv[]) \******************************************************************************************/ #ifdef WIN32 -int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) -{ - main(0, NULL); -} -#endif \ No newline at end of file +//int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) +//{ +// main(0, NULL); +//} +#endif diff --git a/vc/I2CDetectDialog.cpp b/vc/I2CDetectDialog.cpp deleted file mode 100644 index 135660a3..00000000 --- a/vc/I2CDetectDialog.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "I2CDetectDialog.h" -#include "OpenAuraSDK.h" - -IMPLEMENT_DYNAMIC(I2CDetectDialog, CDialogEx) - -I2CDetectDialog::I2CDetectDialog(std::vector& bus, CWnd* pParent) - : CDialogEx(IDD_DIALOG_I2C_DETECT, pParent), busses(bus) -{ - -} - -I2CDetectDialog::~I2CDetectDialog() -{ - -} - -void I2CDetectDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); -} - -BEGIN_MESSAGE_MAP(I2CDetectDialog, CDialogEx) - ON_BN_CLICKED(IDC_BUTTON_I2C_DETECT, &I2CDetectDialog::OnBnClickedButtonI2cDetect) -END_MESSAGE_MAP() - -BOOL I2CDetectDialog::OnInitDialog() -{ - CComboBox* i2c_bus_box = (CComboBox*)GetDlgItem(IDC_COMBO_I2C_BUS); - for (int i = 0; i < busses.size(); i++) - { - i2c_bus_box->AddString(busses[i]->device_name); - } - - i2c_bus_box->SetCurSel(0); - - CFont* myFont = new CFont(); - myFont->CreateFontA(16, 0, 0, 0, FW_DONTCARE, false, false, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, _T("Consolas")); - - CEdit* edit = (CEdit*)GetDlgItem(IDC_EDIT_I2C_DETECT); - edit->SetFont(myFont); - - return TRUE; -} - -void I2CDetectDialog::OnBnClickedButtonI2cDetect() -{ - i2c_smbus_interface* bus = busses[((CComboBox*)GetDlgItem(IDC_COMBO_I2C_BUS))->GetCurSel()]; - - SetDlgItemText(IDC_EDIT_I2C_DETECT, DetectI2C(bus, MODE_QUICK).c_str()); -} \ No newline at end of file diff --git a/vc/I2CDetectDialog.h b/vc/I2CDetectDialog.h deleted file mode 100644 index 8cb11af4..00000000 --- a/vc/I2CDetectDialog.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef I2CDETECT_DIALOG_H -#define I2CDETECT_DIALOG_H - -#include -#include -#include "i2c_smbus.h" -#include "resource.h" - -class I2CDetectDialog : public CDialogEx -{ - DECLARE_DYNAMIC(I2CDetectDialog) - -public: - I2CDetectDialog(std::vector& bus, CWnd* pParent = NULL); - virtual ~I2CDetectDialog(); - virtual BOOL OnInitDialog(); - -private: - -protected: - std::vector& busses; - virtual void DoDataExchange(CDataExchange* pDX); - DECLARE_MESSAGE_MAP() -public: - afx_msg void OnBnClickedButtonI2cDetect(); -}; - -#endif diff --git a/vc/OpenAuraSDKDialog.cpp b/vc/OpenAuraSDKDialog.cpp deleted file mode 100644 index d8378235..00000000 --- a/vc/OpenAuraSDKDialog.cpp +++ /dev/null @@ -1,197 +0,0 @@ -#include "OpenAuraSDKDialog.h" -#include "OpenAuraSDK.h" -#include "I2CDetectDialog.h" - -IMPLEMENT_DYNAMIC(OpenAuraSDKDialog, CDialogEx) - -OpenAuraSDKDialog::OpenAuraSDKDialog(std::vector& bus, std::vector& control, CWnd* pParent) - : CDialogEx(IDD_DIALOG_OPENAURASDK, pParent), busses(bus), controllers (control) -{ - -} - -OpenAuraSDKDialog::~OpenAuraSDKDialog() -{ - -} - -void OpenAuraSDKDialog::DoDataExchange(CDataExchange* pDX) -{ - CDialogEx::DoDataExchange(pDX); -} - -BEGIN_MESSAGE_MAP(OpenAuraSDKDialog, CDialogEx) - ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_I2CDETECT, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkI2cdetect) - ON_CBN_CLOSEUP(IDC_COMBO_OPENAURASDK_DEVICE, &OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkDevice) - ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsAll) - ON_CBN_CLOSEUP(IDC_COMBO_OPENAURASDK_MODE, &OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkMode) - ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_ZONE, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetZone) - ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_LED, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsLed) - ON_BN_CLICKED(IDC_BUTTON_OPENAURASDK_SET_COLORS_DEVICE, &OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsDevice) -END_MESSAGE_MAP() - -BOOL OpenAuraSDKDialog::OnInitDialog() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE); - CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE); - CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED); - - for (int i = 0; i < controllers.size(); i++) - { - controller_box->AddString(controllers[i]->name.c_str()); - } - - controller_box->SetCurSel(0); - - if (controllers.size() > 0) - { - for (int i = 0; i < controllers[0]->modes.size(); i++) - { - mode_box->AddString(controllers[0]->modes[i].name.c_str()); - } - - mode_box->SetCurSel(controllers[0]->GetMode()); - - for (int i = 0; i < controllers[0]->zones.size(); i++) - { - zone_box->AddString(controllers[0]->zones[i].name.c_str()); - } - - zone_box->SetCurSel(0); - - for (int i = 0; i < controllers[0]->leds.size(); i++) - { - led_box->AddString(controllers[0]->leds[i].name.c_str()); - } - - led_box->SetCurSel(0); - } - return TRUE; -} - - -void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkI2cdetect() -{ - I2CDetectDialog dlg(busses); - dlg.DoModal(); -} - - -void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsAll() -{ - RGBColor color = ToRGBColor( - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B) - ); - - for (int i = 0; i < controllers.size(); i++) - { - controllers[i]->SetCustomMode(); - controllers[i]->SetAllLEDs(color); - } -} - - -void OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkDevice() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE); - CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE); - CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED); - - if (controllers.size() > 0) - { - mode_box->ResetContent(); - - for (int i = 0; i < controllers[controller_box->GetCurSel()]->modes.size(); i++) - { - mode_box->AddString(controllers[controller_box->GetCurSel()]->modes[i].name.c_str()); - } - - mode_box->SetCurSel(controllers[controller_box->GetCurSel()]->GetMode()); - - zone_box->ResetContent(); - - for (int i = 0; i < controllers[controller_box->GetCurSel()]->zones.size(); i++) - { - zone_box->AddString(controllers[controller_box->GetCurSel()]->zones[i].name.c_str()); - } - - zone_box->SetCurSel(0); - - led_box->ResetContent(); - - for (int i = 0; i < controllers[controller_box->GetCurSel()]->leds.size(); i++) - { - led_box->AddString(controllers[controller_box->GetCurSel()]->leds[i].name.c_str()); - } - - led_box->SetCurSel(0); - } -} - -void OpenAuraSDKDialog::OnCbnCloseupComboOpenaurasdkMode() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - CComboBox* mode_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_MODE); - - if (controllers.size() > 0) - { - controllers[controller_box->GetCurSel()]->SetMode(mode_box->GetCurSel()); - } -} - - -void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetZone() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - CComboBox* zone_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_ZONE); - - RGBColor color = ToRGBColor( - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B) - ); - - if (controllers.size() > 0) - { - controllers[controller_box->GetCurSel()]->SetAllZoneLEDs(zone_box->GetCurSel(), color); - } -} - - -void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsLed() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - CComboBox* led_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_LED); - - RGBColor color = ToRGBColor( - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B) - ); - - if (controllers.size() > 0) - { - controllers[controller_box->GetCurSel()]->SetLED(led_box->GetCurSel(), color); - } -} - - -void OpenAuraSDKDialog::OnBnClickedButtonOpenaurasdkSetColorsDevice() -{ - CComboBox* controller_box = (CComboBox*)GetDlgItem(IDC_COMBO_OPENAURASDK_DEVICE); - - RGBColor color = ToRGBColor( - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_R), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_G), - GetDlgItemInt(IDC_EDIT_OPENAURASDK_LED_0_B) - ); - - if (controllers.size() > 0) - { - controllers[controller_box->GetCurSel()]->SetAllLEDs(color); - } -} \ No newline at end of file diff --git a/vc/OpenAuraSDKDialog.h b/vc/OpenAuraSDKDialog.h deleted file mode 100644 index 3cd1b9db..00000000 --- a/vc/OpenAuraSDKDialog.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef OPENAURASDK_DIALOG_H -#define OPENAURASDK_DIALOG_H - -#include -#include -#include "i2c_smbus.h" -#include "RGBController.h" -#include "resource.h" - -class OpenAuraSDKDialog : public CDialogEx -{ - DECLARE_DYNAMIC(OpenAuraSDKDialog) - -public: - OpenAuraSDKDialog(std::vector& bus, std::vector& control, CWnd* pParent = NULL); - virtual ~OpenAuraSDKDialog(); - virtual BOOL OnInitDialog(); - -private: - void setMode(unsigned char mode_val); - -protected: - std::vector& busses; - std::vector& controllers; - virtual void DoDataExchange(CDataExchange* pDX); - DECLARE_MESSAGE_MAP() - -public: - afx_msg void OnBnClickedButtonOpenaurasdkI2cdetect(); - afx_msg void OnCbnCloseupComboOpenaurasdkDevice(); - afx_msg void OnBnClickedButtonOpenaurasdkSetColorsAll(); - afx_msg void OnCbnCloseupComboOpenaurasdkMode(); - afx_msg void OnBnClickedButtonOpenaurasdkSetZone(); - afx_msg void OnBnClickedButtonOpenaurasdkSetColorsLed(); - afx_msg void OnBnClickedButtonOpenaurasdkSetColorsDevice(); -}; - -#endif diff --git a/vc/Resource.rc b/vc/Resource.rc deleted file mode 100644 index 07f432f4e757c09a2ea6c5c91dbd02566e38980e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8678 zcmezWPoF`bL4m=SA(J7Qp@<=$p_n0`A&sGgL4hHRA(Nq)p_Cz!A%{VM!I?puL7PE= zA)O(WA&()Ip@<=op@booA%#JKp@<d zi9sQz%uvdZ2Tn<83oEcmh z;u%~Rd>DMd=GHLOFeu>E8N%Sm5X9il5YOPs;KvZkpb56shryA-kHMWGl);g~odJ|i zVImN9?hHN*o(#bZ9t=7R3Jk#vp$tw8xKzY5ghF#Q!Y`0A0$U0I<&Q81e+F*`R|Xfb zTR@>YI5EgSAeX^t1qST793~HB4nhs6wo+g)0OxNAY0O~2Us57_*0oAFXwgj?zhzTGYKxG;z9MIJ&F+jpVpCK6B z_9$g228Tc@Lm9Yr1!}vvFrtu!!hD?Thcv?sJ&H@}BN({aXAom7?>-rpU3(SQf zhasIo2`q2IV1N>m1`HJphT!nSp3|Kf{K0PW2e*kLp!pw?l0hUWPC>DUP!|vNO+14W zxU|(_Fa_Ia&Y;6!2xS{Gm@ybJ=rA}lIDx~|g&_zWs-TuwID;Qb$c8ZlGdP3gLA3~S z$b#w%kp2*`UQoz_Tm-^C;FJVvhQ*!r%?gE5w!-h71Pa5Cg^XP%SO|84AGliX#K4-;~Gz2?a>Mht}l* z;S>)k%OGhT)XxKzSjhPcHKk*ZQCPY}P5+=&X#q}!kP-zw^&`q4Q2&j%vI>{|Ae+M& zJi#qkP`PCe&v~Gn04fh?U4{`3>0of30BTEs%6ZbmI2c^I#4~`x4OANkf%7(~X7*vw zVK8IRVF1+@FcLkqVPy!cWd|x>kTEC+gK7qtx_EFYjhTDn!F4t$uN#1S50Em~2wc7y zLCYQ!1|0@S$pOmwpmG+qYyp)YFuP&)QP*AW3_1+P;M!oYxy%V1SD?H>zRN&mIrbU@ z5~@lJLEsS^T$dO3-Ub!lt`}M{+>pL%3~#gg(d)h(A$lV#0Pffk%!~ zQEFXOKbV2z7i0rAUjz|sQ-JDvSc?s}KS1RNs3ifihrBigEZ;|g+kvP)BCd3W<@_jc z+t?MHfJzXOdafI>8w0n;w*BL^V;pjI7dt_9Sl#68*r z8n;DO1#&Z_-2v*KV;g^j$%4|N8$$?#FLdM>c5Bl^LKMg*|0Kdh4J$8pKEws7DEz%fW9t_IwW+UqQqTZo9Fk zYUGqypl0=W=( Rde39X2d~f|rVRix2>=N80rvm^ diff --git a/vc/resource.h b/vc/resource.h deleted file mode 100644 index 37097779..00000000 --- a/vc/resource.h +++ /dev/null @@ -1,61 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resource.rc -// -#define IDD_DIALOG_I2C_DETECT 101 -#define IDD_DIALOG_OPENAURASDK 103 -#define IDC_COMBO_I2C_BUS 1001 -#define IDC_BUTTON_I2C_DETECT 1002 -#define IDC_EDIT_I2C_DETECT 1003 -#define IDC_BUTTON_OPENAURASDK_I2CDETECT 1004 -#define IDC_RADIO_OPENAURASDK_DIRECT_MODE 1006 -#define IDC_RADIO_OPENAURASDK_EFFECT_MODE 1007 -#define IDC_RADIO_OPENAURASDK_EFFECT_STATIC 1008 -#define IDC_RADIO_OPENAURASDK_EFFECT_OFF 1009 -#define IDC_RADIO_OPENAURASDK_EFFECT_BREATHING 1010 -#define IDC_RADIO_OPENAURASDK_EFFECT_FLASHING 1011 -#define IDC_RADIO_OPENAURASDK_EFFECT_SPECTRUM_CYCLE 1012 -#define IDC_RADIO_OPENAURASDK_EFFECT_RAINBOW 1013 -#define IDC_RADIO_OPENAURASDK_BREATHING_SPECTRUM 1014 -#define IDC_RADIO_OPENAURASDK_EFFECT_CHASE_FADE 1015 -#define IDC_EDIT_OPENAURASDK_LED_0_R 1016 -#define IDC_EDIT_OPENAURASDK_LED_0_G 1017 -#define IDC_EDIT_OPENAURASDK_LED_0_B 1018 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL 1019 -#define IDC_COMBO_OPENAURASDK_DEVICE 1020 -#define IDC_EDIT_OPENAURASDK_LED_1_R 1021 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL2 1021 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS_LED 1021 -#define IDC_EDIT_OPENAURASDK_LED_1_G 1022 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS_ALL3 1022 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS_DEVICE 1022 -#define IDC_EDIT_OPENAURASDK_LED_1_B 1023 -#define IDC_EDIT_OPENAURASDK_LED_2_R 1024 -#define IDC_EDIT_OPENAURASDK_LED_2_G 1025 -#define IDC_EDIT_OPENAURASDK_LED_2_B 1026 -#define IDC_EDIT_OPENAURASDK_LED_3_R 1027 -#define IDC_EDIT_OPENAURASDK_LED_3_G 1028 -#define IDC_EDIT_OPENAURASDK_LED_3_B 1029 -#define IDC_EDIT_OPENAURASDK_LED_4_R 1030 -#define IDC_EDIT_OPENAURASDK_LED_4_G 1031 -#define IDC_EDIT_OPENAURASDK_LED_4_B 1032 -#define IDC_BUTTON1 1033 -#define IDC_BUTTON_OPENAURASDK_DUMP 1033 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS2 1034 -#define IDC_BUTTON_OPENAURASDK_SET_COLORS 1034 -#define IDC_BUTTON_OPENAURASDK_SET_ZONE 1034 -#define IDC_COMBO_OPENAURASDK_DEVICE2 1035 -#define IDC_COMBO_OPENAURASDK_MODE 1035 -#define IDC_COMBO_OPENAURASDK_ZONE 1036 -#define IDC_COMBO_OPENAURASDK_LED 1037 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 105 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1034 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif