Publish LumaOps source

This commit is contained in:
LumaOps release export
2026-09-03 01:18:36 +02:00
commit 7f1c0e5f71
2363 changed files with 501543 additions and 0 deletions
@@ -0,0 +1,99 @@
/*---------------------------------------------------------*\
| LianLiUniversalScreenController.cpp |
| |
| Driver for Lian Li 8.8" Universal Screen LEDs |
| |
| Adam Honse <calcprogrammer1@gmail.com> 17 Dec 2025 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include <iomanip>
#include <sstream>
#include "LianLiUniversalScreenController.h"
LianLiUniversalScreenController::LianLiUniversalScreenController(libusb_device_handle* device)
{
dev = device;
/*-----------------------------------------------------*\
| Fill in location string with USB ID |
\*-----------------------------------------------------*/
libusb_device_descriptor descriptor;
libusb_get_device_descriptor(libusb_get_device(dev), &descriptor);
std::stringstream location_stream;
location_stream << std::hex << std::setfill('0') << std::setw(4) << descriptor.idVendor << ":" << std::hex << std::setfill('0') << std::setw(4) << descriptor.idProduct;
location = location_stream.str();
/*-----------------------------------------------------*\
| Fill in the serial string from the string descriptor |
\*-----------------------------------------------------*/
char serialStr[64];
int ret = libusb_get_string_descriptor_ascii(dev, descriptor.iSerialNumber, reinterpret_cast<unsigned char*>(serialStr), sizeof(serialStr));
if(ret > 0)
{
serial = std::string(serialStr, ret);
}
}
LianLiUniversalScreenController::~LianLiUniversalScreenController()
{
if(dev)
{
libusb_close(dev);
}
}
std::string LianLiUniversalScreenController::GetLocation()
{
return("USB: " + location);
}
std::string LianLiUniversalScreenController::GetSerial()
{
return(serial);
}
std::string LianLiUniversalScreenController::GetVersion()
{
return("");
}
void LianLiUniversalScreenController::SetLedColors(RGBColor* colors, size_t count)
{
std::size_t leds_in_packet = 20;
unsigned char offset = 0;
unsigned char usb_buf[64];
memset(usb_buf, 0, sizeof(usb_buf));
do
{
usb_buf[0] = 0x11;
usb_buf[1] = offset;
usb_buf[2] = 0;
usb_buf[3] = 0;
if((count - offset) < leds_in_packet)
{
leds_in_packet = count - offset;
}
for(std::size_t led_idx = 0; led_idx < leds_in_packet; led_idx++)
{
usb_buf[4 + (led_idx * 3)] = RGBGetRValue(colors[offset + led_idx]);
usb_buf[5 + (led_idx * 3)] = RGBGetGValue(colors[offset + led_idx]);
usb_buf[6 + (led_idx * 3)] = RGBGetBValue(colors[offset + led_idx]);
}
offset += (unsigned char)leds_in_packet;
int actual_length = sizeof(usb_buf);
libusb_bulk_transfer(dev, 1, usb_buf, sizeof(usb_buf), &actual_length, 25);
} while( offset < count );
}
@@ -0,0 +1,36 @@
/*---------------------------------------------------------*\
| LianLiUniversalScreenController.h |
| |
| Driver for Lian Li 8.8" Universal Screen LEDs |
| |
| Adam Honse <calcprogrammer1@gmail.com> 17 Dec 2025 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <string>
#include <libusb.h>
#include "RGBController.h"
class LianLiUniversalScreenController
{
public:
LianLiUniversalScreenController(libusb_device_handle* device);
~LianLiUniversalScreenController();
std::string GetVersion();
std::string GetLocation();
std::string GetSerial();
void SetLedColors(RGBColor* colors, size_t count);
private:
libusb_device_handle* dev;
std::string version;
std::string location;
std::string serial;
};
@@ -0,0 +1,95 @@
/*---------------------------------------------------------*\
| RGBController_LianLiUniversalScreen.cpp |
| |
| RGBController for Lian Li 8.8" Universal Screen LEDs |
| |
| Adam Honse <calcprogrammer1@gmail.com> 17 Dec 2025 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_LianLiUniversalScreen.h"
/**------------------------------------------------------------------*\
@name Lian Li Universal Screen
@category Monitor
@type USB
@save :x:
@direct :white_check_mark:
@effects :x:
@detectors DetectLianLiUniversalScreenControllers
@comment Only controls the LEDs around the screen, not the screen
itself.
\*-------------------------------------------------------------------*/
RGBController_LianLiUniversalScreen::RGBController_LianLiUniversalScreen(LianLiUniversalScreenController* controller_ptr)
{
controller = controller_ptr;
name = "Lian Li Universal Screen";
type = DEVICE_TYPE_MONITOR;
vendor = "Lian Li";
description = "Lian Li Universal Screen Device";
location = controller->GetLocation();
serial = controller->GetSerial();
version = controller->GetVersion();
mode Direct;
Direct.name = "Direct";
Direct.value = 0;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
SetupZones();
}
void RGBController_LianLiUniversalScreen::SetupZones()
{
zone Screen;
Screen.name = "Screen Lighting";
Screen.type = ZONE_TYPE_LINEAR;
Screen.leds_min = 60;
Screen.leds_max = 60;
Screen.leds_count = 60;
Screen.matrix_map = NULL;
zones.push_back(Screen);
for(std::size_t led_idx = 0; led_idx < Screen.leds_count; led_idx++)
{
led ScreenLED;
ScreenLED.name = "Screen Lighting LED " + std::to_string(led_idx);
ScreenLED.value = 0;
leds.push_back(ScreenLED);
}
SetupColors();
}
void RGBController_LianLiUniversalScreen::ResizeZone(int /*zone*/, int /*new_size*/)
{
}
void RGBController_LianLiUniversalScreen::DeviceUpdateLEDs()
{
controller->SetLedColors(colors.data(), colors.size());
}
void RGBController_LianLiUniversalScreen::UpdateZoneLEDs(int /*zone*/)
{
DeviceUpdateLEDs();
}
void RGBController_LianLiUniversalScreen::UpdateSingleLED(int /*led*/)
{
DeviceUpdateLEDs();
}
void RGBController_LianLiUniversalScreen::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
@@ -0,0 +1,33 @@
/*---------------------------------------------------------*\
| RGBController_LianLiUniversalScreen.h |
| |
| RGBController for Lian Li 8.8" Universal Screen LEDs |
| |
| Adam Honse <calcprogrammer1@gmail.com> 17 Dec 2025 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "LianLiUniversalScreenController.h"
#include "RGBController.h"
class RGBController_LianLiUniversalScreen : public RGBController
{
public:
RGBController_LianLiUniversalScreen(LianLiUniversalScreenController* controller_ptr);
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
private:
LianLiUniversalScreenController* controller;
};