Compare commits

..
Author SHA1 Message Date
Adam Honse 6434600fae Use NULL (shared) libusb context 2021-04-19 18:30:31 -05:00
Luca Lovisa 95af3eea32 Add support for the Lian Li Uni Hub
Commits squashed and amended for code style by Adam Honse <[email protected]>
2021-04-18 22:05:48 -05:00
24 changed files with 277 additions and 580 deletions
+23 -23
View File
@@ -29,7 +29,7 @@ before_script:
#-----------------------------------------------------------------------#
# Linux (AppImage) 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 AppImage":
build_linux_32:
<<: *ccache_init
image: i386/ubuntu:bionic
stage: build
@@ -38,7 +38,6 @@ before_script:
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_${CI_COMMIT_SHORT_SHA}"
paths:
- OpenRGB-i386.AppImage
- 60-openrgb.rules
@@ -48,7 +47,7 @@ before_script:
#-----------------------------------------------------------------------#
# Linux (AppImage) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 AppImage":
build_linux_64:
<<: *ccache_init
image: ubuntu:bionic
stage: build
@@ -57,7 +56,6 @@ before_script:
- ./scripts/build-appimage.sh
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_${CI_COMMIT_SHORT_SHA}"
paths:
- OpenRGB-x86_64.AppImage
- 60-openrgb.rules
@@ -67,7 +65,7 @@ before_script:
#-----------------------------------------------------------------------#
# Linux (.deb) 32-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 32 deb":
build_linux_deb32:
<<: *ccache_init
image: i386/ubuntu:bionic
stage: build
@@ -79,7 +77,6 @@ before_script:
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_32_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
@@ -89,7 +86,7 @@ before_script:
#-----------------------------------------------------------------------#
# Linux (.deb) 64-bit Build Target #
#-----------------------------------------------------------------------#
"Linux 64 deb":
build_linux_deb64:
<<: *ccache_init
image: ubuntu:bionic
stage: build
@@ -101,7 +98,6 @@ before_script:
- mv -v ../openrgb*.deb ./
artifacts:
name: "${CI_PROJECT_NAME}_Linux_64_deb_${CI_COMMIT_SHORT_SHA}"
paths:
- openrgb*.deb
exclude:
@@ -111,7 +107,7 @@ before_script:
#-----------------------------------------------------------------------#
# Windows (32-bit) Build Target #
#-----------------------------------------------------------------------#
"Windows 32":
build_windows_32:
extends:
- .shared_windows_runners
stage: build
@@ -164,23 +160,26 @@ before_script:
- ..\_qt\5.15.0\msvc2019\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\
- _fold_final_
- _fold_start_ 'Moving results for upload'
- mv release ../'OpenRGB Windows 32-bit'
- _fold_start_ 'compressing the release folder so that we can upload it as artifact'
- mv release 'OpenRGB Windows 32-bit'
- ${datetime} = Get-Date ([datetime]::UtcNow) -Format "yyyy-MM-ddTHH-mm-ss"
- ${revision} = ((git rev-parse --short HEAD) | Out-String).Trim()
- ${rversion} = (((Get-Content '..\OpenRGB.pro' | Select-String -Pattern "VERSION =") | Out-String).Trim().Split("="))[1].Trim()
- 7z a -mx9 -r -y "OpenRGB_${rversion}_32_${revision}_nightly_${datetime}.7z" 'OpenRGB Windows 32-bit'
- _fold_final_
# cache:
# key: same-key
# paths:
# - C:\vcpkg\installed\
artifacts:
name: "${CI_PROJECT_NAME}_Windows_32_${CI_COMMIT_SHORT_SHA}"
paths:
- 'OpenRGB Windows 32-bit'
- _build/*.7z
expire_in: 30 days
#-----------------------------------------------------------------------#
# Windows (64-bit) Build Target #
#-----------------------------------------------------------------------#
"Windows 64":
build_windows_64:
extends:
- .shared_windows_runners
stage: build
@@ -233,23 +232,26 @@ before_script:
- ..\_qt\5.15.0\msvc2019_64\bin\windeployqt --no-angle --no-translations --no-opengl-sw --no-system-d3d-compiler --no-compiler-runtime --no-webkit2 .\release\
- _fold_final_
- _fold_start_ 'Moving results for upload'
- mv release ../'OpenRGB Windows 64-bit'
- _fold_start_ 'compressing the release folder so that we can upload it as artifact'
- mv release 'OpenRGB Windows 64-bit'
- ${datetime} = Get-Date ([datetime]::UtcNow) -Format "yyyy-MM-ddTHH-mm-ss"
- ${revision} = ((git rev-parse --short HEAD) | Out-String).Trim()
- ${rversion} = (((Get-Content '..\OpenRGB.pro' | Select-String -Pattern "VERSION =") | Out-String).Trim().Split("="))[1].Trim()
- 7z a -mx9 -r -y "OpenRGB_${rversion}_64_${revision}_nightly_${datetime}.7z" 'OpenRGB Windows 64-bit'
- _fold_final_
# cache:
# key: same-key
# paths:
# - C:\vcpkg\installed\
artifacts:
name: "${CI_PROJECT_NAME}_Windows_64_${CI_COMMIT_SHORT_SHA}"
paths:
- 'OpenRGB Windows 64-bit'
- _build/*.7z
expire_in: 30 days
#-----------------------------------------------------------------------#
# MacOS Build Target #
#-----------------------------------------------------------------------#
"MacOS ARM64":
build_macos_arm64:
tags:
- macos
stage: build
@@ -260,7 +262,6 @@ before_script:
- macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
paths:
- OpenRGB.app
expire_in: 30 days
@@ -271,7 +272,7 @@ before_script:
- if: '$BUILD_MACOS =~ /.+/'
when: on_success
"MacOS Intel":
build_macos_intel:
tags:
- macos
stage: build
@@ -282,7 +283,6 @@ before_script:
- arch -x86_64 macdeployqt OpenRGB.app -codesign=OpenRGB
artifacts:
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
paths:
- OpenRGB.app
expire_in: 30 days
@@ -291,4 +291,4 @@ before_script:
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB"'
when: on_success
- if: '$BUILD_MACOS =~ /.+/'
when: on_success
when: on_success
@@ -140,7 +140,7 @@ void RGBController_CMR6000Controller::UpdateSingleLED(int /*led*/)
void RGBController_CMR6000Controller::SetCustomMode()
{
active_mode = 1;
}
void RGBController_CMR6000Controller::DeviceUpdateMode()
@@ -1,30 +0,0 @@
#include "CreativeSoundBlasterXG6Controller.h"
#include "RGBController_CreativeSoundBlasterXG6.h"
#include "Detector.h"
#include <hidapi/hidapi.h>
/*-----------------------------------------------------*\
| Creative vendor ID |
\*-----------------------------------------------------*/
#define CREATIVE_VID 0x041E
/*-----------------------------------------------------*\
| SoundCards |
\*-----------------------------------------------------*/
#define CREATIVE_SOUNDBLASTERX_G6_PID 0x3256
void DetectCreativeDevice(hid_device_info* info, const std::string& name)
{
hid_device* dev = hid_open_path(info->path);
if(dev)
{
CreativeSoundBlasterXG6Controller* controller = new CreativeSoundBlasterXG6Controller(dev, info->path);
RGBController_CreativeSoundBlasterXG6* rgb_controller = new RGBController_CreativeSoundBlasterXG6(controller);
rgb_controller->name = name;
ResourceManager::get()->RegisterRGBController(rgb_controller);
}
}
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\
| Sound Cards |
\*-------------------------------------------------------------------------------------------------------------------------------------------------*/
REGISTER_HID_DETECTOR_I("Creative SoundBlasterX G6", DetectCreativeDevice, CREATIVE_VID, CREATIVE_SOUNDBLASTERX_G6_PID, 4);
@@ -1,82 +0,0 @@
#include "CreativeSoundBlasterXG6Controller.h"
CreativeSoundBlasterXG6Controller::CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path)
{
dev = dev_handle;
location = path;
}
CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller()
{
hid_close(dev);
}
std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation()
{
return("HID " + location);
}
void CreativeSoundBlasterXG6Controller::SetLedColor (unsigned char red, unsigned char green, unsigned char blue)
{
unsigned char usb_buf[64];
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
//5A 3A 02 06 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
usb_buf[0x01] = 0x5A;
usb_buf[0x02] = 0x3A;
usb_buf[0x03] = 0x02;
usb_buf[0x04] = 0x06;
usb_buf[0x05] = 0x01;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 64);
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
//5A 3A 06 04 00 03 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
usb_buf[0x01] = 0x5A;
usb_buf[0x02] = 0x3A;
usb_buf[0x03] = 0x06;
usb_buf[0x04] = 0x04;
usb_buf[0x06] = 0x03;
usb_buf[0x07] = 0x01;
usb_buf[0x09] = 0x01;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 64);
/*-----------------------------------------------------*\
| Zero out buffer |
\*-----------------------------------------------------*/
memset(usb_buf, 0x00, sizeof(usb_buf));
//5A 3A 09 0A 00 03 01 01 FF BB GG RR
usb_buf[0x01] = 0x5A;
usb_buf[0x02] = 0x3A;
usb_buf[0x03] = 0x09;
usb_buf[0x04] = 0x0A;
usb_buf[0x06] = 0x03;
usb_buf[0x07] = 0x01;
usb_buf[0x08] = 0x01;
usb_buf[0x09] = 0x0FF;
usb_buf[0x0A] = blue;
usb_buf[0x0B] = green;
usb_buf[0x0C] = red;
/*-----------------------------------------------------*\
| Send packet |
\*-----------------------------------------------------*/
hid_write(dev, (unsigned char *)usb_buf, 64);
}
@@ -1,20 +0,0 @@
#include "RGBController.h"
#include <cstring>
#include <hidapi/hidapi.h>
#pragma once
class CreativeSoundBlasterXG6Controller
{
public:
CreativeSoundBlasterXG6Controller(hid_device* dev_handle, const char* path);
~CreativeSoundBlasterXG6Controller();
void SetLedColor (unsigned char red, unsigned char green, unsigned char blue);
std::string GetDeviceLocation();
std::string GetSerialString();
private:
hid_device* dev;
std::string location;
};
@@ -1,81 +0,0 @@
#include "RGBController_CreativeSoundBlasterXG6.h"
RGBController_CreativeSoundBlasterXG6::RGBController_CreativeSoundBlasterXG6(CreativeSoundBlasterXG6Controller* creative_device)
{
creative = creative_device;
name = "Creative SoundBlasterX G6 Device";
vendor = "Creative";
type = DEVICE_TYPE_HEADSET;
description = "Creative SoundBlasterX G6 Device";
location = creative_device->GetDeviceLocation();
serial = "";
mode Static;
Static.name = "Direct";
Static.value = 0;
Static.flags = MODE_COLORS_PER_LED;
Static.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Static);
SetupZones();
}
RGBController_CreativeSoundBlasterXG6::~RGBController_CreativeSoundBlasterXG6()
{
delete creative;
}
void RGBController_CreativeSoundBlasterXG6::SetupZones()
{
zone logo_zone;
logo_zone.name = "Logo";
logo_zone.type = ZONE_TYPE_SINGLE;
logo_zone.leds_min = 1;
logo_zone.leds_max = 1;
logo_zone.leds_count = 1;
logo_zone.matrix_map = NULL;
zones.push_back(logo_zone);
led logo_led;
logo_led.name = "Logo";
leds.push_back(logo_led);
SetupColors();
}
void RGBController_CreativeSoundBlasterXG6::ResizeZone(int /*zone*/, int /*new_size*/)
{
/*---------------------------------------------------------*\
| This device does not support resizing zones |
\*---------------------------------------------------------*/
}
void RGBController_CreativeSoundBlasterXG6::DeviceUpdateLEDs()
{
unsigned char red = RGBGetRValue(colors[0]);
unsigned char grn = RGBGetGValue(colors[0]);
unsigned char blu = RGBGetBValue(colors[0]);
creative->SetLedColor(red, grn, blu);
}
void RGBController_CreativeSoundBlasterXG6::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_CreativeSoundBlasterXG6::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_CreativeSoundBlasterXG6::SetCustomMode()
{
active_mode = 0;
}
void RGBController_CreativeSoundBlasterXG6::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
@@ -1,24 +0,0 @@
#pragma once
#include "RGBController.h"
#include "CreativeSoundBlasterXG6Controller.h"
class RGBController_CreativeSoundBlasterXG6: public RGBController
{
public:
RGBController_CreativeSoundBlasterXG6(CreativeSoundBlasterXG6Controller* creative_device);
~RGBController_CreativeSoundBlasterXG6();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
private:
CreativeSoundBlasterXG6Controller* creative;
};
@@ -41,7 +41,6 @@ static const gpu_pci_device device_list[] =
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, EVGA_SUB_VEN, EVGA_RTX2080_XC_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 XC Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080_A_DEV, EVGA_SUB_VEN, EVGA_RTX2080_XC_ULTRA_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080 XC Ultra Gaming" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, EVGA_SUB_VEN, EVGA_RTX2080TI_XC_ULTRA_GAMING_SUB_DEV, EVGA_RGB_V2, "EVGA GeForce RTX 2080Ti XC Ultra" },
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, EVGA_SUB_VEN, EVGA_RTX2080TI_FTW3_ULTRA_SUB_DEV , EVGA_RGB_V2, "EVGA GeForce RTX 2080Ti FTW3 Ultra" },
};
@@ -182,7 +182,7 @@ void RGBController_EVGAGPUv2::UpdateSingleLED(int /*led*/)
void RGBController_EVGAGPUv2::SetCustomMode()
{
active_mode = getModeIndex(EVGA_GPU_V2_RGB_MODE_DIRECT);
active_mode = getModeIndex(EVGA_GPU_V2_MODE_DIRECT);
}
void RGBController_EVGAGPUv2::DeviceUpdateMode()
@@ -33,11 +33,7 @@
#define STEELSERIES_RIVAL_300_DOTA_PID 0x1392
#define STEELSERIES_RIVAL_300_HP_PID 0x1718
#define STEELSERIES_RIVAL_300_BLACKOPS_PID 0x1710
#define STEELSERIES_RIVAL_310_PID 0x1720
#define STEELSERIES_RIVAL_310_CSGO_HOWL_PID 0x171e
#define STEELSERIES_RIVAL_310_PUBG_PID 0x1736
#define STEELSERIES_SENSEI_TEN_PID 0x1832
#define STEELSERIES_SENSEI_TEN_CSGO_NEON_RIDER_PID 0x1834
#define STEELSERIES_SENSEI_310_PID 0x1722
/*-----------------------------------------------------*\
| Headset product IDs |
@@ -165,11 +161,7 @@ REGISTER_HID_DETECTOR_I("SteelSeries Rival 300 CS:GO Hyperbeast Edition", Dete
REGISTER_HID_DETECTOR_I("SteelSeries Rival 300 Dota 2 Edition", DetectSteelSeriesRival300, STEELSERIES_VID, STEELSERIES_RIVAL_300_DOTA_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Rival 300 HP Omen Edition", DetectSteelSeriesRival300, STEELSERIES_VID, STEELSERIES_RIVAL_300_HP_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Rival 300 Black Ops Edition", DetectSteelSeriesRival300, STEELSERIES_VID, STEELSERIES_RIVAL_300_BLACKOPS_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Rival 310", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_RIVAL_310_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Rival 310 CS:GO Howl Edition", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_RIVAL_310_CSGO_HOWL_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Rival 310 PUBG Edition", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_RIVAL_310_PUBG_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Sensei TEN", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_SENSEI_TEN_PID, 0 );
REGISTER_HID_DETECTOR_I("SteelSeries Sensei TEN CS:GO Neon Rider Edition", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_SENSEI_TEN_CSGO_NEON_RIDER_PID,0 );
REGISTER_HID_DETECTOR_I("SteelSeries Sensei 310", DetectSteelSeriesSensei, STEELSERIES_VID, STEELSERIES_SENSEI_310_PID, 0 );
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------*\
| Headsets |
-6
View File
@@ -67,7 +67,6 @@ INCLUDEPATH +=
Controllers/CorsairLightingNodeController/ \
Controllers/CorsairVengeanceController/ \
Controllers/CorsairVengeanceProController/ \
Controllers/CreativeController/ \
Controllers/CrucialController/ \
Controllers/DasKeyboardController/ \
Controllers/DebugController/ \
@@ -196,8 +195,6 @@ HEADERS +=
Controllers/CorsairVengeanceController/RGBController_CorsairVengeance.h \
Controllers/CorsairVengeanceProController/CorsairVengeanceProController.h \
Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.h \
Controllers/CreativeController/CreativeSoundBlasterXG6Controller.h \
Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.h \
Controllers/CrucialController/CrucialController.h \
Controllers/CrucialController/RGBController_Crucial.h \
Controllers/DasKeyboardController/DasKeyboardController.h \
@@ -444,9 +441,6 @@ SOURCES +=
Controllers/CorsairVengeanceProController/CorsairVengeanceProController.cpp \
Controllers/CorsairVengeanceProController/CorsairVengeanceProControllerDetect.cpp \
Controllers/CorsairVengeanceProController/RGBController_CorsairVengeancePro.cpp \
Controllers/CreativeController/CreativeSoundBlasterXG6Controller.cpp \
Controllers/CreativeController/CreativeControllerDetect.cpp \
Controllers/CreativeController/RGBController_CreativeSoundBlasterXG6.cpp \
Controllers/CrucialController/CrucialController.cpp \
Controllers/CrucialController/CrucialControllerDetect.cpp \
Controllers/CrucialController/RGBController_Crucial.cpp \
-1
View File
@@ -178,7 +178,6 @@ There have been two instances of hardware damage in OpenRGB's development and we
* OpenRGB E1.31 Receiver Plugin (by me): https://gitlab.com/CalcProgrammer1/OpenRGBE131ReceiverPlugin
* Auto Updates Plugin (by herosilas12): https://gitlab.com/herosilas12/OpenRGB-Plugins/-/tree/Updates
* Effects Engine Plugin (by herosilas12): https://gitlab.com/OpenRGBDevelopers/OpenRGBEffectPlugin
* OpenRGB Visual Map Plugin (by morg): https://gitlab.com/OpenRGBDevelopers/OpenRGBVisualMapPlugin
## Projects Used
-8
View File
@@ -1369,12 +1369,6 @@ void RGBController::UnregisterUpdateCallback(void * callback_arg)
}
}
void RGBController::ClearCallbacks()
{
UpdateCallbacks.clear();
UpdateCallbackArgs.clear();
}
void RGBController::SignalUpdate()
{
UpdateMutex.lock();
@@ -1465,8 +1459,6 @@ std::string device_type_to_str(device_type type)
return "Light";
case DEVICE_TYPE_SPEAKER:
return "Speaker";
case DEVICE_TYPE_VIRTUAL:
return "Virtual";
default:
return "Unknown";
}
-3
View File
@@ -118,7 +118,6 @@ enum
DEVICE_TYPE_GAMEPAD,
DEVICE_TYPE_LIGHT,
DEVICE_TYPE_SPEAKER,
DEVICE_TYPE_VIRTUAL,
DEVICE_TYPE_UNKNOWN
};
@@ -176,7 +175,6 @@ public:
virtual void RegisterUpdateCallback(RGBControllerCallback new_callback, void * new_callback_arg) = 0;
virtual void UnregisterUpdateCallback(void * callback_arg) = 0;
virtual void ClearCallbacks() = 0;
virtual void SignalUpdate() = 0;
virtual void UpdateLEDs() = 0;
@@ -255,7 +253,6 @@ public:
void RegisterUpdateCallback(RGBControllerCallback new_callback, void * new_callback_arg);
void UnregisterUpdateCallback(void * callback_arg);
void ClearCallbacks();
void SignalUpdate();
void UpdateLEDs();
-32
View File
@@ -91,38 +91,6 @@ void ResourceManager::RegisterRGBController(RGBController *rgb_controller)
DeviceListChanged();
}
void ResourceManager::UnregisterRGBController(RGBController *rgb_controller)
{
LOG_NOTICE("Unregistering RGB controller: %s", rgb_controller->name.c_str());
/*-------------------------------------------------------------------------*\
| Clear callbacks from the controller before removal |
\*-------------------------------------------------------------------------*/
rgb_controller->ClearCallbacks();
/*-------------------------------------------------------------------------*\
| Find the controller to remove and remove it from the hardware list |
\*-------------------------------------------------------------------------*/
std::vector<RGBController*>::iterator hw_it = std::find(rgb_controllers_hw.begin(), rgb_controllers_hw.end(), rgb_controller);
if (hw_it != rgb_controllers_hw.end())
{
rgb_controllers_hw.erase(hw_it);
}
/*-------------------------------------------------------------------------*\
| Find the controller to remove and remove it from the master list |
\*-------------------------------------------------------------------------*/
std::vector<RGBController*>::iterator rgb_it = std::find(rgb_controllers.begin(), rgb_controllers.end(), rgb_controller);
if (rgb_it != rgb_controllers.end())
{
rgb_controllers.erase(rgb_it);
}
DeviceListChanged();
}
std::vector<RGBController*> & ResourceManager::GetRGBControllers()
{
return rgb_controllers;
-2
View File
@@ -56,7 +56,6 @@ public:
virtual std::vector<i2c_smbus_interface*> & GetI2CBusses() = 0;
virtual void RegisterRGBController(RGBController *rgb_controller) = 0;
virtual void UnregisterRGBController(RGBController *rgb_controller) = 0;
virtual void RegisterDeviceListChangeCallback(DeviceListChangeCallback new_callback, void * new_callback_arg) = 0;
virtual void RegisterDetectionProgressCallback(DetectionProgressCallback new_callback, void * new_callback_arg) = 0;
@@ -93,7 +92,6 @@ public:
std::vector<i2c_smbus_interface*> & GetI2CBusses();
void RegisterRGBController(RGBController *rgb_controller);
void UnregisterRGBController(RGBController *rgb_controller);
std::vector<RGBController*> & GetRGBControllers();
-1
View File
@@ -98,7 +98,6 @@
#define EVGA_RTX2080_XC_GAMING_SUB_DEV 0x2182
#define EVGA_RTX2080_XC_ULTRA_GAMING_SUB_DEV 0x2183
#define EVGA_RTX2080TI_XC_ULTRA_GAMING_SUB_DEV 0x2383
#define EVGA_RTX2080TI_FTW3_ULTRA_SUB_DEV 0x2487
/*-----------------------------------------------------*\
| Gainward Sub-Device IDs |
+78 -65
View File
@@ -72,45 +72,80 @@ OpenRGBDevicePage::OpenRGBDevicePage(RGBController *dev, QWidget *parent) :
/*-----------------------------------------------------*\
| Set up the color palette buttons |
\*-----------------------------------------------------*/
ui->ButtonBlack->setStyleSheet("QPushButton {background-color: rgb(0,0,0); color: rgb(0,0,0); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonBlack->setFlat(true);
ui->ButtonBlack->setMinimumWidth(20);
ui->ButtonBlack->update();
#ifdef _WIN32
if(((OpenRGBDialog2 *)parent)->IsDarkTheme())
{
ui->ButtonRed->setStyleSheet("QPushButton {background-color: rgb(255,0,0); color: rgb(255,0,0);}");
ui->ButtonRed->setFlat(true);
ui->ButtonRed->update();
ui->ButtonRed->setStyleSheet("QPushButton {background-color: rgb(255,0,0); color: rgb(255,0,0); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonRed->setFlat(true);
ui->ButtonRed->setMinimumWidth(20);
ui->ButtonRed->update();
ui->ButtonYellow->setStyleSheet("QPushButton {background-color: rgb(255,255,0); color: rgb(255,255,0);}");
ui->ButtonYellow->setFlat(true);
ui->ButtonYellow->update();
ui->ButtonYellow->setStyleSheet("QPushButton {background-color: rgb(255,255,0); color: rgb(255,255,0); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonYellow->setFlat(true);
ui->ButtonYellow->setMinimumWidth(20);
ui->ButtonYellow->update();
ui->ButtonGreen->setStyleSheet("QPushButton {background-color: rgb(0,255,0); color: rgb(0,255,0);}");
ui->ButtonGreen->setFlat(true);
ui->ButtonGreen->update();
ui->ButtonGreen->setStyleSheet("QPushButton {background-color: rgb(0,255,0); color: rgb(0,255,0); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonGreen->setFlat(true);
ui->ButtonGreen->setMinimumWidth(20);
ui->ButtonGreen->update();
ui->ButtonCyan->setStyleSheet("QPushButton {background-color: rgb(0,255,255); color: rgb(0,255,255);}");
ui->ButtonCyan->setFlat(true);
ui->ButtonCyan->update();
ui->ButtonCyan->setStyleSheet("QPushButton {background-color: rgb(0,255,255); color: rgb(0,255,255); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonCyan->setFlat(true);
ui->ButtonCyan->setMinimumWidth(20);
ui->ButtonCyan->update();
ui->ButtonBlue->setStyleSheet("QPushButton {background-color: rgb(0,0,255); color: rgb(0,0,255);}");
ui->ButtonBlue->setFlat(true);
ui->ButtonBlue->update();
ui->ButtonBlue->setStyleSheet("QPushButton {background-color: rgb(0,0,255); color: rgb(0,0,255); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonBlue->setFlat(true);
ui->ButtonBlue->setMinimumWidth(20);
ui->ButtonBlue->update();
ui->ButtonMagenta->setStyleSheet("QPushButton {background-color: rgb(255,0,255); color: rgb(255,0,255);}");
ui->ButtonMagenta->setFlat(true);
ui->ButtonMagenta->update();
}
else
#endif
{
QPalette pal;
ui->ButtonMagenta->setStyleSheet("QPushButton {background-color: rgb(255,0,255); color: rgb(255,0,255); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonMagenta->setFlat(true);
ui->ButtonMagenta->setMinimumWidth(20);
ui->ButtonMagenta->update();
pal = ui->ButtonRed->palette();
pal.setColor(QPalette::Button, QColor(255, 0, 0));
ui->ButtonRed->setAutoFillBackground(true);
ui->ButtonRed->setPalette(pal);
ui->ButtonRed->setFlat(true);
ui->ButtonRed->update();
ui->ButtonWhite->setStyleSheet("QPushButton {background-color: rgb(255,255,255); color: rgb(255,255,255); border: 1px solid rgb(128, 128, 128); padding-top: 1px; padding-bottom: 1px;}");
ui->ButtonWhite->setFlat(true);
ui->ButtonWhite->setMinimumWidth(20);
ui->ButtonWhite->update();
pal = ui->ButtonYellow->palette();
pal.setColor(QPalette::Button, QColor(255, 255, 0));
ui->ButtonYellow->setAutoFillBackground(true);
ui->ButtonYellow->setPalette(pal);
ui->ButtonYellow->setFlat(true);
ui->ButtonYellow->update();
pal = ui->ButtonGreen->palette();
pal.setColor(QPalette::Button, QColor(0, 255, 0));
ui->ButtonGreen->setAutoFillBackground(true);
ui->ButtonGreen->setPalette(pal);
ui->ButtonGreen->setFlat(true);
ui->ButtonGreen->update();
pal = ui->ButtonCyan->palette();
pal.setColor(QPalette::Button, QColor(0, 255, 255));
ui->ButtonCyan->setAutoFillBackground(true);
ui->ButtonCyan->setPalette(pal);
ui->ButtonCyan->setFlat(true);
ui->ButtonCyan->update();
pal = ui->ButtonBlue->palette();
pal.setColor(QPalette::Button, QColor(0, 0, 255));
ui->ButtonBlue->setAutoFillBackground(true);
ui->ButtonBlue->setPalette(pal);
ui->ButtonBlue->setFlat(true);
ui->ButtonBlue->update();
pal = ui->ButtonMagenta->palette();
pal.setColor(QPalette::Button, QColor(255, 0, 255));
ui->ButtonMagenta->setAutoFillBackground(true);
ui->ButtonMagenta->setPalette(pal);
ui->ButtonMagenta->setFlat(true);
ui->ButtonMagenta->update();
}
/*-----------------------------------------------------*\
| Fill in the mode selection box |
@@ -210,12 +245,6 @@ void Ui::OpenRGBDevicePage::on_ZoneBox_currentIndexChanged(int /*index*/)
ui->DeviceViewBox->clearSelection();
ui->DeviceViewBox->blockSignals(false);
}
ui->ApplyColorsButton->setText("Apply Colors To This Device");
}
else
{
//If the index has been changed and there is more than one zone change the "Apply" text
ui->ApplyColorsButton->setText("Apply Colors To The Selection");
}
selected_zone = selected_zone - 1;
}
@@ -296,12 +325,6 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
ui->DeviceViewBox->clearSelection();
ui->DeviceViewBox->blockSignals(false);
}
ui->ApplyColorsButton->setText("Apply Colors To This Device");
}
else
{
//If the index has been changed and there is more than one zone change the "Apply" text
ui->ApplyColorsButton->setText("Apply Colors To The Selection");
}
index = index - 1;
}
@@ -374,17 +397,17 @@ void Ui::OpenRGBDevicePage::on_LEDBox_currentIndexChanged(int index)
case MODE_COLORS_MODE_SPECIFIC:
{
/*-----------------------------------------------------*\
| Update color picker with color of selected mode |
\*-----------------------------------------------------*/
RGBColor color = device->modes[selected_mode].colors[index];
UpdatingColor = true;
ui->RedSpinBox->setValue(RGBGetRValue(color));
ui->GreenSpinBox->setValue(RGBGetGValue(color));
ui->BlueSpinBox->setValue(RGBGetBValue(color));
UpdatingColor = false;
updateHSV();
updateWheel();
/*-----------------------------------------------------*\
| Update color picker with color of selected mode |
\*-----------------------------------------------------*/
RGBColor color = device->modes[selected_mode].colors[index];
UpdatingColor = true;
ui->RedSpinBox->setValue(RGBGetRValue(color));
ui->GreenSpinBox->setValue(RGBGetGValue(color));
ui->BlueSpinBox->setValue(RGBGetBValue(color));
UpdatingColor = false;
updateHSV();
updateWheel();
}
break;
}
@@ -929,11 +952,6 @@ void Ui::OpenRGBDevicePage::SetCustomMode(unsigned char red, unsigned char green
UpdateMode();
}
void Ui::OpenRGBDevicePage::on_ButtonBlack_clicked()
{
SetDevice(0, 0, 0);
}
void Ui::OpenRGBDevicePage::on_ButtonRed_clicked()
{
SetDevice(255, 0, 0);
@@ -964,11 +982,6 @@ void Ui::OpenRGBDevicePage::on_ButtonMagenta_clicked()
SetDevice(255, 0, 255);
}
void Ui::OpenRGBDevicePage::on_ButtonWhite_clicked()
{
SetDevice(255, 255, 255);
}
void Ui::OpenRGBDevicePage::on_ColorWheelBox_colorChanged(const QColor color)
{
if(UpdatingColor)
-3
View File
@@ -45,15 +45,12 @@ private slots:
void on_ValSpinBox_valueChanged(int arg1);
void on_DeviceViewBox_selectionChanged(QVector<int>);
void on_ButtonBlack_clicked();
void on_ButtonRed_clicked();
void on_ButtonYellow_clicked();
void on_ButtonGreen_clicked();
void on_ButtonCyan_clicked();
void on_ButtonBlue_clicked();
void on_ButtonMagenta_clicked();
void on_ButtonWhite_clicked();
void on_SetAllButton_clicked();
void on_RandomCheck_clicked();
void on_PerLEDCheck_clicked();
+174 -183
View File
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>875</width>
<height>374</height>
</rect>
</property>
@@ -14,10 +14,58 @@
<string>Frame</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="4">
<widget class="QPushButton" name="SelectAllLEDsButton">
<item row="12" column="8">
<widget class="QPushButton" name="ButtonCyan">
<property name="text">
<string>Select All</string>
<string/>
</property>
</widget>
</item>
<item row="7" column="1" colspan="4">
<widget class="QComboBox" name="ModeBox"/>
</item>
<item row="7" column="5">
<widget class="QLabel" name="RedLabel">
<property name="text">
<string>R:</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="ColorLabel">
<property name="text">
<string>Colors:</string>
</property>
</widget>
</item>
<item row="12" column="1" colspan="4">
<widget class="QComboBox" name="DirectionBox"/>
</item>
<item row="12" column="9">
<widget class="QPushButton" name="ButtonBlue">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="7" column="6" colspan="2">
<widget class="QSpinBox" name="RedSpinBox">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QPushButton" name="ApplyColorsButton">
<property name="text">
<string>Apply Colors</string>
</property>
</widget>
</item>
<item row="12" column="6">
<widget class="QPushButton" name="ButtonYellow">
<property name="text">
<string/>
</property>
</widget>
</item>
@@ -37,141 +85,49 @@
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="ResizeButton">
<property name="text">
<string>Resize</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="SpeedLabel">
<property name="text">
<string>Speed:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QRadioButton" name="PerLEDCheck">
<property name="text">
<string>Per-LED</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="ColorLabel">
<property name="text">
<string>Colors:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="LEDLabel">
<property name="text">
<string>LED:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<item row="7" column="0">
<widget class="QLabel" name="ModeLabel">
<property name="text">
<string>Mode:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QComboBox" name="LEDBox"/>
</item>
<item row="3" column="1" colspan="3">
<widget class="QPushButton" name="ApplyColorsButton">
<property name="text">
<string>Apply Colors To Selection</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QRadioButton" name="RandomCheck">
<property name="text">
<string>Random</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="4">
<item row="9" column="1" colspan="4">
<widget class="QSlider" name="SpeedSlider">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="4">
<item row="8" column="8">
<widget class="QLabel" name="SatLabel">
<property name="text">
<string>S:</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="4">
<widget class="QPushButton" name="SetAllButton">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;Sets all devices to&lt;br/&gt;&lt;b&gt;Static&lt;/b&gt; mode and&lt;br/&gt;applies the selected color.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Apply All Devices</string>
<string>Set All Devices</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="ZoneLabel">
<item row="3" column="0">
<widget class="QLabel" name="LEDLabel">
<property name="text">
<string>Zone:</string>
<string>LED:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="3">
<widget class="QComboBox" name="ZoneBox"/>
</item>
<item row="4" column="1" colspan="4">
<widget class="QComboBox" name="ModeBox"/>
</item>
<item row="9" column="1" colspan="4">
<widget class="QComboBox" name="DirectionBox"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="DirectionLabel">
<item row="12" column="5">
<widget class="QPushButton" name="ButtonRed">
<property name="text">
<string>Dir:</string>
<string/>
</property>
</widget>
</item>
<item row="5" column="2" colspan="2">
<widget class="QRadioButton" name="ModeSpecificCheck">
<property name="text">
<string>Mode-Specific</string>
</property>
</widget>
</item>
<item row="9" column="5">
<widget class="QLabel" name="BlueLabel">
<property name="text">
<string>B:</string>
</property>
</widget>
</item>
<item row="6" column="5">
<widget class="QLabel" name="GreenLabel">
<property name="text">
<string>G:</string>
</property>
</widget>
</item>
<item row="5" column="5">
<widget class="QLabel" name="RedLabel">
<property name="text">
<string>R:</string>
</property>
</widget>
</item>
<item row="5" column="6" colspan="2">
<widget class="QSpinBox" name="RedSpinBox">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="6" column="6" colspan="2">
<item row="8" column="6" colspan="2">
<widget class="QSpinBox" name="GreenSpinBox">
<property name="maximum">
<number>255</number>
@@ -192,31 +148,80 @@
</property>
</widget>
</item>
<item row="6" column="8">
<widget class="QLabel" name="SatLabel">
<item row="12" column="0">
<widget class="QLabel" name="DirectionLabel">
<property name="text">
<string>S:</string>
<string>Dir:</string>
</property>
</widget>
</item>
<item row="5" column="8">
<item row="8" column="2" colspan="2">
<widget class="QRadioButton" name="ModeSpecificCheck">
<property name="text">
<string>Mode-Specific</string>
</property>
</widget>
</item>
<item row="12" column="10">
<widget class="QPushButton" name="ButtonMagenta">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="8" column="9" colspan="2">
<widget class="QSpinBox" name="SatSpinBox">
<property name="maximum">
<number>255</number>
</property>
</widget>
</item>
<item row="7" column="8">
<widget class="QLabel" name="HueLabel">
<property name="text">
<string>H:</string>
</property>
</widget>
</item>
<item row="5" column="9" colspan="2">
<item row="8" column="5">
<widget class="QLabel" name="GreenLabel">
<property name="text">
<string>G:</string>
</property>
</widget>
</item>
<item row="7" column="9" colspan="2">
<widget class="QSpinBox" name="HueSpinBox">
<property name="maximum">
<number>359</number>
</property>
</widget>
</item>
<item row="6" column="9" colspan="2">
<widget class="QSpinBox" name="SatSpinBox">
<property name="maximum">
<number>255</number>
<item row="8" column="4">
<widget class="QRadioButton" name="RandomCheck">
<property name="text">
<string>Random</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="SpeedLabel">
<property name="text">
<string>Speed:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QRadioButton" name="PerLEDCheck">
<property name="text">
<string>Per-LED</string>
</property>
</widget>
</item>
<item row="12" column="7">
<widget class="QPushButton" name="ButtonGreen">
<property name="text">
<string/>
</property>
</widget>
</item>
@@ -227,67 +232,41 @@
</property>
</widget>
</item>
<item row="4" column="5" colspan="6">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="ButtonBlack">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonRed">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonYellow">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonGreen">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonCyan">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonBlue">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonMagenta">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="ButtonWhite">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
<item row="9" column="5">
<widget class="QLabel" name="BlueLabel">
<property name="text">
<string>B:</string>
</property>
</widget>
</item>
<item row="1" column="5" rowspan="3" colspan="6">
<item row="3" column="1" colspan="3">
<widget class="QComboBox" name="LEDBox"/>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="SelectAllLEDsButton">
<property name="text">
<string>Select All</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QPushButton" name="ResizeButton">
<property name="text">
<string>Resize</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="ZoneLabel">
<property name="text">
<string>Zone:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QComboBox" name="ZoneBox"/>
</item>
<item row="2" column="5" rowspan="4" colspan="6">
<widget class="ColorWheel" name="ColorWheelBox" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -325,6 +304,18 @@
<tabstop>RandomCheck</tabstop>
<tabstop>SpeedSlider</tabstop>
<tabstop>DirectionBox</tabstop>
<tabstop>RedSpinBox</tabstop>
<tabstop>GreenSpinBox</tabstop>
<tabstop>BlueSpinBox</tabstop>
<tabstop>HueSpinBox</tabstop>
<tabstop>SatSpinBox</tabstop>
<tabstop>ValSpinBox</tabstop>
<tabstop>ButtonRed</tabstop>
<tabstop>ButtonYellow</tabstop>
<tabstop>ButtonGreen</tabstop>
<tabstop>ButtonCyan</tabstop>
<tabstop>ButtonBlue</tabstop>
<tabstop>ButtonMagenta</tabstop>
</tabstops>
<resources/>
<connections/>
-3
View File
@@ -65,9 +65,6 @@ static QString GetIconString(device_type type, bool dark)
case DEVICE_TYPE_SPEAKER:
filename = "speaker";
break;
case DEVICE_TYPE_VIRTUAL:
filename = "virtual";
break;
default:
filename = "unknown";
break;
-2
View File
@@ -36,7 +36,5 @@
<file>plugin_dark.png</file>
<file>speaker.png</file>
<file>speaker_dark.png</file>
<file>virtual.png</file>
<file>virtual_dark.png</file>
</qresource>
</RCC>
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB