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
File diff suppressed because it is too large Load Diff
+429
View File
@@ -0,0 +1,429 @@
/*---------------------------------------------------------*\
| RGBController.h |
| |
| OpenRGB's RGB controller hardware abstration layer, |
| provides a generic representation of an RGB device |
| |
| Adam Honse (CalcProgrammer1) 02 Jun 2019 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <atomic>
#include <vector>
#include <string>
#include <thread>
#include <chrono>
#include <mutex>
/*------------------------------------------------------------------*\
| RGB Color Type and Conversion Macros |
\*------------------------------------------------------------------*/
typedef unsigned int RGBColor;
#define RGBGetRValue(rgb) (rgb & 0x000000FF)
#define RGBGetGValue(rgb) ((rgb >> 8) & 0x000000FF)
#define RGBGetBValue(rgb) ((rgb >> 16) & 0x000000FF)
#define ToRGBColor(r, g, b) ((RGBColor)((b << 16) | (g << 8) | (r)))
#define RGBToBGRColor(rgb) ((rgb & 0xFF) << 16 | (rgb & 0xFF00) | (rgb & 0xFF0000) >> 16)
/*------------------------------------------------------------------*\
| Mode Flags |
\*------------------------------------------------------------------*/
enum
{
MODE_FLAG_HAS_SPEED = (1 << 0), /* Mode has speed parameter */
MODE_FLAG_HAS_DIRECTION_LR = (1 << 1), /* Mode has left/right parameter */
MODE_FLAG_HAS_DIRECTION_UD = (1 << 2), /* Mode has up/down parameter */
MODE_FLAG_HAS_DIRECTION_HV = (1 << 3), /* Mode has horiz/vert parameter */
MODE_FLAG_HAS_BRIGHTNESS = (1 << 4), /* Mode has brightness parameter */
MODE_FLAG_HAS_PER_LED_COLOR = (1 << 5), /* Mode has per-LED colors */
MODE_FLAG_HAS_MODE_SPECIFIC_COLOR = (1 << 6), /* Mode has mode specific colors */
MODE_FLAG_HAS_RANDOM_COLOR = (1 << 7), /* Mode has random color option */
MODE_FLAG_MANUAL_SAVE = (1 << 8), /* Mode can manually be saved */
MODE_FLAG_AUTOMATIC_SAVE = (1 << 9), /* Mode automatically saves */
};
/*------------------------------------------------------------------*\
| Mode Directions |
\*------------------------------------------------------------------*/
enum
{
MODE_DIRECTION_LEFT = 0, /* Mode direction left */
MODE_DIRECTION_RIGHT = 1, /* Mode direction right */
MODE_DIRECTION_UP = 2, /* Mode direction up */
MODE_DIRECTION_DOWN = 3, /* Mode direction down */
MODE_DIRECTION_HORIZONTAL = 4, /* Mode direction horizontal */
MODE_DIRECTION_VERTICAL = 5, /* Mode direction vertical */
};
/*------------------------------------------------------------------*\
| Mode Color Types |
\*------------------------------------------------------------------*/
enum
{
MODE_COLORS_NONE = 0, /* Mode has no colors */
MODE_COLORS_PER_LED = 1, /* Mode has per LED colors selected */
MODE_COLORS_MODE_SPECIFIC = 2, /* Mode specific colors selected */
MODE_COLORS_RANDOM = 3, /* Mode has random colors selected */
};
/*------------------------------------------------------------------*\
| Mode Class |
\*------------------------------------------------------------------*/
class mode
{
public:
/*--------------------------------------------------------------*\
| Mode Information |
\*--------------------------------------------------------------*/
std::string name; /* Mode name */
int value; /* Device-specific mode value */
unsigned int flags; /* Mode flags bitfield */
unsigned int speed_min; /* speed minimum value */
unsigned int speed_max; /* speed maximum value */
unsigned int brightness_min; /*brightness min value */
unsigned int brightness_max; /*brightness max value */
unsigned int colors_min; /* minimum number of mode colors*/
unsigned int colors_max; /* maximum numver of mode colors*/
/*--------------------------------------------------------------*\
| Mode Settings |
\*--------------------------------------------------------------*/
unsigned int speed; /* Mode speed parameter value */
unsigned int brightness; /* Mode brightness value */
unsigned int direction; /* Mode direction value */
unsigned int color_mode; /* Mode color selection */
std::vector<RGBColor>
colors; /* mode-specific colors */
/*--------------------------------------------------------------*\
| Mode Constructor / Destructor |
\*--------------------------------------------------------------*/
mode();
~mode();
};
/*------------------------------------------------------------------*\
| LED Struct |
\*------------------------------------------------------------------*/
typedef struct
{
std::string name; /* LED name */
unsigned int value; /* Device-specific LED value */
} led;
/*------------------------------------------------------------------*\
| Zone Flags |
\*------------------------------------------------------------------*/
enum
{
ZONE_FLAG_RESIZE_EFFECTS_ONLY = (1 << 0), /* Zone is resizable, but only for */
/* effects - treat as single LED */
};
/*------------------------------------------------------------------*\
| Zone Types |
\*------------------------------------------------------------------*/
typedef int zone_type;
enum
{
ZONE_TYPE_SINGLE,
ZONE_TYPE_LINEAR,
ZONE_TYPE_MATRIX
};
/*------------------------------------------------------------------*\
| Matrix Map Struct |
\*------------------------------------------------------------------*/
typedef struct
{
unsigned int height;
unsigned int width;
unsigned int * map;
} matrix_map_type;
/*------------------------------------------------------------------*\
| Segment Struct |
\*------------------------------------------------------------------*/
typedef struct
{
std::string name; /* Segment name */
zone_type type; /* Segment type */
unsigned int start_idx; /* Start index within zone */
unsigned int leds_count; /* Number of LEDs in segment*/
} segment;
/*------------------------------------------------------------------*\
| Zone Class |
\*------------------------------------------------------------------*/
class zone
{
public:
std::string name; /* Zone name */
zone_type type; /* Zone type */
led * leds; /* List of LEDs in zone */
RGBColor * colors; /* Colors of LEDs in zone */
unsigned int start_idx; /* Start index of led/color */
unsigned int leds_count; /* Number of LEDs in zone */
unsigned int leds_min; /* Minimum number of LEDs */
unsigned int leds_max; /* Maximum number of LEDs */
matrix_map_type * matrix_map; /* Matrix map pointer */
std::vector<segment> segments; /* Segments in zone */
unsigned int flags; /* Zone flags bitfield */
/*--------------------------------------------------------------*\
| Zone Constructor / Destructor |
\*--------------------------------------------------------------*/
zone();
~zone();
};
/*------------------------------------------------------------------*\
| Device Types |
| The enum order should be maintained as is for the API however |
| DEVICE_TYPE_UNKNOWN needs to remain last. Any new device types |
| need to be inserted at the end of the list but before unknown. |
\*------------------------------------------------------------------*/
typedef int device_type;
enum
{
DEVICE_TYPE_MOTHERBOARD,
DEVICE_TYPE_DRAM,
DEVICE_TYPE_GPU,
DEVICE_TYPE_COOLER,
DEVICE_TYPE_LEDSTRIP,
DEVICE_TYPE_KEYBOARD,
DEVICE_TYPE_MOUSE,
DEVICE_TYPE_MOUSEMAT,
DEVICE_TYPE_HEADSET,
DEVICE_TYPE_HEADSET_STAND,
DEVICE_TYPE_GAMEPAD,
DEVICE_TYPE_LIGHT,
DEVICE_TYPE_SPEAKER,
DEVICE_TYPE_VIRTUAL,
DEVICE_TYPE_STORAGE,
DEVICE_TYPE_CASE,
DEVICE_TYPE_MICROPHONE,
DEVICE_TYPE_ACCESSORY,
DEVICE_TYPE_KEYPAD,
DEVICE_TYPE_LAPTOP,
DEVICE_TYPE_MONITOR,
DEVICE_TYPE_UNKNOWN,
};
/*------------------------------------------------------------------*\
| Controller Flags |
\*------------------------------------------------------------------*/
enum
{
CONTROLLER_FLAG_LOCAL = (1 << 0), /* Device is local to this instance */
CONTROLLER_FLAG_REMOTE = (1 << 1), /* Device is on a remote instance */
CONTROLLER_FLAG_VIRTUAL = (1 << 2), /* Device is a virtual device */
CONTROLLER_FLAG_RESET_BEFORE_UPDATE = (1 << 8), /* Device resets update flag before */
/* calling update function */
};
/*------------------------------------------------------------------*\
| RGBController Callback Types |
\*------------------------------------------------------------------*/
typedef void (*RGBControllerCallback)(void *);
std::string device_type_to_str(device_type type);
class RGBControllerInterface
{
public:
virtual void SetupColors() = 0;
virtual unsigned int GetLEDsInZone(unsigned int zone) = 0;
virtual std::string GetName() = 0;
virtual std::string GetVendor() = 0;
virtual std::string GetDescription() = 0;
virtual std::string GetVersion() = 0;
virtual std::string GetSerial() = 0;
virtual std::string GetLocation() = 0;
virtual std::string GetModeName(unsigned int mode) = 0;
virtual std::string GetZoneName(unsigned int zone) = 0;
virtual std::string GetLEDName(unsigned int led) = 0;
virtual RGBColor GetLED(unsigned int led) = 0;
virtual void SetLED(unsigned int led, RGBColor color) = 0;
virtual void SetAllLEDs(RGBColor color) = 0;
virtual void SetAllZoneLEDs(int zone, RGBColor color) = 0;
virtual int GetMode() = 0;
virtual void SetMode(int mode) = 0;
virtual unsigned char * GetDeviceDescription(unsigned int protocol_version) = 0;
virtual void ReadDeviceDescription(unsigned char* data_buf, unsigned int protocol_version) = 0;
virtual unsigned char * GetModeDescription(int mode, unsigned int protocol_version) = 0;
virtual void SetModeDescription(unsigned char* data_buf, unsigned int protocol_version) = 0;
virtual unsigned char * GetColorDescription() = 0;
virtual void SetColorDescription(unsigned char* data_buf) = 0;
virtual unsigned char * GetZoneColorDescription(int zone) = 0;
virtual void SetZoneColorDescription(unsigned char* data_buf) = 0;
virtual unsigned char * GetSingleLEDColorDescription(int led) = 0;
virtual void SetSingleLEDColorDescription(unsigned char* data_buf) = 0;
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;
//virtual void UpdateZoneLEDs(int zone) = 0;
//virtual void UpdateSingleLED(int led) = 0;
virtual void UpdateMode() = 0;
virtual void SaveMode() = 0;
virtual void DeviceCallThreadFunction() = 0;
virtual void ClearSegments(int zone) = 0;
virtual void AddSegment(int zone, segment new_segment) = 0;
/*---------------------------------------------------------*\
| Functions to be implemented in device implementation |
\*---------------------------------------------------------*/
virtual void SetupZones() = 0;
virtual void ResizeZone(int zone, int new_size) = 0;
virtual void DeviceUpdateLEDs() = 0;
virtual void UpdateZoneLEDs(int zone) = 0;
virtual void UpdateSingleLED(int led) = 0;
virtual void DeviceUpdateMode() = 0;
virtual void DeviceSaveMode() = 0;
virtual void SetCustomMode() = 0;
};
class RGBController : public RGBControllerInterface
{
public:
std::string name; /* controller name */
std::string vendor; /* controller vendor */
std::string description; /* controller description */
std::string version; /* controller version */
std::string serial; /* controller serial number */
std::string location; /* controller location */
std::vector<led> leds; /* LEDs */
std::vector<zone> zones; /* Zones */
std::vector<mode> modes; /* Modes */
std::vector<RGBColor> colors; /* Color buffer */
device_type type; /* device type */
int active_mode = 0;/* active mode */
std::vector<std::string>
led_alt_names; /* alternate LED names */
unsigned int flags; /* controller flags */
/*---------------------------------------------------------*\
| RGBController base class constructor |
\*---------------------------------------------------------*/
RGBController();
virtual ~RGBController();
/*---------------------------------------------------------*\
| Generic functions implemented in RGBController.cpp |
\*---------------------------------------------------------*/
void SetupColors();
unsigned int GetLEDsInZone(unsigned int zone);
std::string GetName();
std::string GetVendor();
std::string GetDescription();
std::string GetVersion();
std::string GetSerial();
std::string GetLocation();
std::string GetModeName(unsigned int mode);
std::string GetZoneName(unsigned int zone);
std::string GetLEDName(unsigned int led);
RGBColor GetLED(unsigned int led);
void SetLED(unsigned int led, RGBColor color);
void SetAllLEDs(RGBColor color);
void SetAllZoneLEDs(int zone, RGBColor color);
int GetMode();
void SetMode(int mode);
unsigned char * GetDeviceDescription(unsigned int protocol_version);
void ReadDeviceDescription(unsigned char* data_buf, unsigned int protocol_version);
unsigned char * GetModeDescription(int mode, unsigned int protocol_version);
void SetModeDescription(unsigned char* data_buf, unsigned int protocol_version);
unsigned char * GetColorDescription();
void SetColorDescription(unsigned char* data_buf);
unsigned char * GetZoneColorDescription(int zone);
void SetZoneColorDescription(unsigned char* data_buf);
unsigned char * GetSingleLEDColorDescription(int led);
void SetSingleLEDColorDescription(unsigned char* data_buf);
unsigned char * GetSegmentDescription(int zone, segment new_segment);
void SetSegmentDescription(unsigned char* data_buf);
void RegisterUpdateCallback(RGBControllerCallback new_callback, void * new_callback_arg);
void UnregisterUpdateCallback(void * callback_arg);
void ClearCallbacks();
void SignalUpdate();
void UpdateLEDs();
//void UpdateZoneLEDs(int zone);
//void UpdateSingleLED(int led);
void UpdateMode();
void SaveMode();
void DeviceCallThreadFunction();
void ClearSegments(int zone);
void AddSegment(int zone, segment new_segment);
/*---------------------------------------------------------*\
| Functions to be implemented in device implementation |
\*---------------------------------------------------------*/
virtual void SetupZones() = 0;
virtual void ResizeZone(int zone, int new_size) = 0;
virtual void DeviceUpdateLEDs() = 0;
virtual void UpdateZoneLEDs(int zone) = 0;
virtual void UpdateSingleLED(int led) = 0;
virtual void DeviceUpdateMode() = 0;
void DeviceSaveMode();
void SetCustomMode();
private:
std::thread* DeviceCallThread;
std::atomic<bool> CallFlag_UpdateLEDs;
std::atomic<bool> CallFlag_UpdateMode;
std::atomic<bool> DeviceThreadRunning;
//bool CallFlag_UpdateZoneLEDs = false;
//bool CallFlag_UpdateSingleLED = false;
//bool CallFlag_UpdateMode = false;
std::mutex UpdateMutex;
std::vector<RGBControllerCallback> UpdateCallbacks;
std::vector<void *> UpdateCallbackArgs;
};
+209
View File
@@ -0,0 +1,209 @@
/*---------------------------------------------------------*\
| RGBControllerKeyNames.cpp |
| |
| List of standardized names to represent keyboard keys |
| when naming LEDs on keyboard devices |
| |
| Chris M (Dr_No) 25 Jan 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBControllerKeyNames.h"
const char* KEY_EN_UNUSED = "";
const char* ZONE_EN_KEYBOARD = "Keyboard";
const char* KEY_EN_ESCAPE = "Key: Escape";
const char* KEY_EN_F1 = "Key: F1";
const char* KEY_EN_F2 = "Key: F2";
const char* KEY_EN_F3 = "Key: F3";
const char* KEY_EN_F4 = "Key: F4";
const char* KEY_EN_F5 = "Key: F5";
const char* KEY_EN_F6 = "Key: F6";
const char* KEY_EN_F7 = "Key: F7";
const char* KEY_EN_F8 = "Key: F8";
const char* KEY_EN_F9 = "Key: F9";
const char* KEY_EN_F10 = "Key: F10";
const char* KEY_EN_F11 = "Key: F11";
const char* KEY_EN_F12 = "Key: F12";
const char* KEY_EN_PRINT_SCREEN = "Key: Print Screen";
const char* KEY_EN_SCROLL_LOCK = "Key: Scroll Lock";
const char* KEY_EN_PAUSE_BREAK = "Key: Pause/Break";
const char* KEY_EN_POWER = "Key: Power";
const char* KEY_EN_BACK_TICK = "Key: `";
const char* KEY_EN_1 = "Key: 1";
const char* KEY_EN_2 = "Key: 2";
const char* KEY_EN_3 = "Key: 3";
const char* KEY_EN_4 = "Key: 4";
const char* KEY_EN_5 = "Key: 5";
const char* KEY_EN_6 = "Key: 6";
const char* KEY_EN_7 = "Key: 7";
const char* KEY_EN_8 = "Key: 8";
const char* KEY_EN_9 = "Key: 9";
const char* KEY_EN_0 = "Key: 0";
const char* KEY_EN_MINUS = "Key: -";
const char* KEY_EN_PLUS = "Key: +";
const char* KEY_EN_EQUALS = "Key: =";
const char* KEY_EN_BACKSPACE = "Key: Backspace";
const char* KEY_EN_INSERT = "Key: Insert";
const char* KEY_EN_HOME = "Key: Home";
const char* KEY_EN_PAGE_UP = "Key: Page Up";
const char* KEY_EN_TAB = "Key: Tab";
const char* KEY_EN_Q = "Key: Q";
const char* KEY_EN_W = "Key: W";
const char* KEY_EN_E = "Key: E";
const char* KEY_EN_R = "Key: R";
const char* KEY_EN_T = "Key: T";
const char* KEY_EN_Y = "Key: Y";
const char* KEY_EN_U = "Key: U";
const char* KEY_EN_I = "Key: I";
const char* KEY_EN_O = "Key: O";
const char* KEY_EN_P = "Key: P";
const char* KEY_EN_LEFT_BRACKET = "Key: [";
const char* KEY_EN_RIGHT_BRACKET = "Key: ]";
const char* KEY_EN_BACK_SLASH = "Key: \\";
const char* KEY_EN_ANSI_BACK_SLASH = "Key: \\ (ANSI)";
const char* KEY_EN_DELETE = "Key: Delete";
const char* KEY_EN_END = "Key: End";
const char* KEY_EN_PAGE_DOWN = "Key: Page Down";
const char* KEY_EN_CAPS_LOCK = "Key: Caps Lock";
const char* KEY_EN_A = "Key: A";
const char* KEY_EN_S = "Key: S";
const char* KEY_EN_D = "Key: D";
const char* KEY_EN_F = "Key: F";
const char* KEY_EN_G = "Key: G";
const char* KEY_EN_H = "Key: H";
const char* KEY_EN_J = "Key: J";
const char* KEY_EN_K = "Key: K";
const char* KEY_EN_L = "Key: L";
const char* KEY_EN_SEMICOLON = "Key: ;";
const char* KEY_EN_QUOTE = "Key: '";
const char* KEY_EN_POUND = "Key: #";
const char* KEY_EN_ANSI_ENTER = "Key: Enter";
const char* KEY_EN_ISO_ENTER = "Key: Enter (ISO)";
const char* KEY_EN_LEFT_SHIFT = "Key: Left Shift";
const char* KEY_EN_ISO_BACK_SLASH = "Key: \\ (ISO)";
const char* KEY_EN_Z = "Key: Z";
const char* KEY_EN_X = "Key: X";
const char* KEY_EN_C = "Key: C";
const char* KEY_EN_V = "Key: V";
const char* KEY_EN_B = "Key: B";
const char* KEY_EN_N = "Key: N";
const char* KEY_EN_M = "Key: M";
const char* KEY_EN_COMMA = "Key: ,";
const char* KEY_EN_PERIOD = "Key: .";
const char* KEY_EN_FORWARD_SLASH = "Key: /";
const char* KEY_EN_RIGHT_SHIFT = "Key: Right Shift";
const char* KEY_EN_UP_ARROW = "Key: Up Arrow";
const char* KEY_EN_LEFT_CONTROL = "Key: Left Control";
const char* KEY_EN_LEFT_WINDOWS = "Key: Left Windows";
const char* KEY_EN_LEFT_FUNCTION = "Key: Left Fn";
const char* KEY_EN_LEFT_ALT = "Key: Left Alt";
const char* KEY_EN_SPACE = "Key: Space";
const char* KEY_EN_RIGHT_ALT = "Key: Right Alt";
const char* KEY_EN_RIGHT_FUNCTION = "Key: Right Fn";
const char* KEY_EN_RIGHT_WINDOWS = "Key: Right Windows";
const char* KEY_EN_MENU = "Key: Menu";
const char* KEY_EN_RIGHT_CONTROL = "Key: Right Control";
const char* KEY_EN_LEFT_ARROW = "Key: Left Arrow";
const char* KEY_EN_DOWN_ARROW = "Key: Down Arrow";
const char* KEY_EN_RIGHT_ARROW = "Key: Right Arrow";
const char* KEY_EN_NUMPAD_LOCK = "Key: Num Lock";
const char* KEY_EN_NUMPAD_DIVIDE = "Key: Number Pad /";
const char* KEY_EN_NUMPAD_TIMES = "Key: Number Pad *";
const char* KEY_EN_NUMPAD_MINUS = "Key: Number Pad -";
const char* KEY_EN_NUMPAD_PLUS = "Key: Number Pad +";
const char* KEY_EN_NUMPAD_PERIOD = "Key: Number Pad .";
const char* KEY_EN_NUMPAD_ENTER = "Key: Number Pad Enter";
const char* KEY_EN_NUMPAD_EQUAL = "Key: Number Pad =";
const char* KEY_EN_NUMPAD_0 = "Key: Number Pad 0";
const char* KEY_EN_NUMPAD_1 = "Key: Number Pad 1";
const char* KEY_EN_NUMPAD_2 = "Key: Number Pad 2";
const char* KEY_EN_NUMPAD_3 = "Key: Number Pad 3";
const char* KEY_EN_NUMPAD_4 = "Key: Number Pad 4";
const char* KEY_EN_NUMPAD_5 = "Key: Number Pad 5";
const char* KEY_EN_NUMPAD_6 = "Key: Number Pad 6";
const char* KEY_EN_NUMPAD_7 = "Key: Number Pad 7";
const char* KEY_EN_NUMPAD_8 = "Key: Number Pad 8";
const char* KEY_EN_NUMPAD_9 = "Key: Number Pad 9";
const char* KEY_EN_MEDIA_PLAY_PAUSE = "Key: Media Play/Pause";
const char* KEY_EN_MEDIA_PREVIOUS = "Key: Media Previous";
const char* KEY_EN_MEDIA_NEXT = "Key: Media Next";
const char* KEY_EN_MEDIA_STOP = "Key: Media Stop";
const char* KEY_EN_MEDIA_MUTE = "Key: Media Mute";
const char* KEY_EN_MEDIA_VOLUME_DOWN = "Key: Media Volume -";
const char* KEY_EN_MEDIA_VOLUME_UP = "Key: Media Volume +";
const char* KEY_EN_F13 = "Key: F13";
const char* KEY_EN_F14 = "Key: F14";
const char* KEY_EN_F15 = "Key: F15";
const char* KEY_EN_F16 = "Key: F16";
const char* KEY_EN_F17 = "Key: F17";
const char* KEY_EN_F18 = "Key: F18";
const char* KEY_EN_F19 = "Key: F19";
const char* KEY_EN_F20 = "Key: F20";
const char* KEY_EN_F21 = "Key: F21";
const char* KEY_EN_F22 = "Key: F22";
const char* KEY_EN_F23 = "Key: F23";
const char* KEY_EN_F24 = "Key: F24";
const char* KEY_JP_RO = "Key: _";
const char* KEY_JP_EJ = "Key: E/J";
const char* KEY_JP_ZENKAKU = "Key: 半角/全角";
const char* KEY_JP_KANA = "Key: かな";
const char* KEY_JP_HENKAN = "Key: 変換";
const char* KEY_JP_MUHENKAN = "Key: 無変換";
const char* KEY_JP_YEN = "Key: ¥";
const char* KEY_JP_AT = "Key: @";
const char* KEY_JP_CHEVRON = "Key: ^";
const char* KEY_JP_COLON = "Key: :";
const char* KEY_JP_KATAKANA = "Key: カタカナ";
const char* KEY_JP_HIRAGANA = "Key: ひらがな";
const char* KEY_KR_HAN = "Key: 한/영";
const char* KEY_KR_HANJA = "Key: 한자";
const char* KEY_NORD_AAL = "Key: Å";
const char* KEY_NORD_A_OE = "Key: Ä Ø";
const char* KEY_NORD_O_AE = "Key: Ö Æ";
const char* KEY_NORD_HALF = "Key: § ½";
const char* KEY_NORD_HYPHEN = "Key: - _";
const char* KEY_NORD_PLUS_QUESTION = "Key: + ?";
const char* KEY_NORD_ACUTE_GRAVE = "Key: ´ `";
const char* KEY_NORD_DOTS_CARET = "Key: ¨ ^";
const char* KEY_NORD_QUOTE = "Key: ' *";
const char* KEY_NORD_ANGLE_BRACKET = "Key: < >";
const char* KEY_DE_ESZETT = "Key: ß";
const char* KEY_DE_DIAERESIS_A = "Key: Ä";
const char* KEY_DE_DIAERESIS_O = "Key: Ö";
const char* KEY_DE_DIAERESIS_U = "Key: Ü";
const char* KEY_FR_SUPER_2 = "Key: ²";
const char* KEY_FR_AMPERSAND = "Key: &";
const char* KEY_FR_ACUTE_E = "Key: é";
const char* KEY_FR_DOUBLEQUOTE = "Key: \"";
const char* KEY_FR_LEFT_PARENTHESIS = "Key: (";
const char* KEY_FR_GRAVE_E = "Key: è";
const char* KEY_FR_UNDERSCORE = "Key: _";
const char* KEY_FR_CEDILLA_C = "Key: ç";
const char* KEY_FR_GRAVE_A = "Key: à";
const char* KEY_FR_RIGHT_PARENTHESIS = "Key: )";
const char* KEY_FR_DOLLAR = "Key: $";
const char* KEY_FR_GRAVE_U = "Key: ù";
const char* KEY_FR_ASTERIX = "Key: *";
const char* KEY_FR_EXCLAIMATION = "Key: !";
const char* KEY_ES_OPEN_QUESTION_MARK = "Key: ¿/¡";
const char* KEY_ES_TILDE = "Key: ´";
const char* KEY_ES_ENIE = "Key: Ñ";
const char* KEY_BR_TILDE = "Key: ~";
+209
View File
@@ -0,0 +1,209 @@
/*---------------------------------------------------------*\
| RGBControllerKeyNames.h |
| |
| List of standardized names to represent keyboard keys |
| when naming LEDs on keyboard devices |
| |
| Chris M (Dr_No) 25 Jan 2022 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
extern const char* KEY_EN_UNUSED;
extern const char* ZONE_EN_KEYBOARD;
extern const char* KEY_EN_ESCAPE;
extern const char* KEY_EN_F1;
extern const char* KEY_EN_F2;
extern const char* KEY_EN_F3;
extern const char* KEY_EN_F4;
extern const char* KEY_EN_F5;
extern const char* KEY_EN_F6;
extern const char* KEY_EN_F7;
extern const char* KEY_EN_F8;
extern const char* KEY_EN_F9;
extern const char* KEY_EN_F10;
extern const char* KEY_EN_F11;
extern const char* KEY_EN_F12;
extern const char* KEY_EN_PRINT_SCREEN;
extern const char* KEY_EN_SCROLL_LOCK;
extern const char* KEY_EN_PAUSE_BREAK;
extern const char* KEY_EN_POWER;
extern const char* KEY_EN_BACK_TICK;
extern const char* KEY_EN_1;
extern const char* KEY_EN_2;
extern const char* KEY_EN_3;
extern const char* KEY_EN_4;
extern const char* KEY_EN_5;
extern const char* KEY_EN_6;
extern const char* KEY_EN_7;
extern const char* KEY_EN_8;
extern const char* KEY_EN_9;
extern const char* KEY_EN_0;
extern const char* KEY_EN_MINUS;
extern const char* KEY_EN_PLUS;
extern const char* KEY_EN_EQUALS;
extern const char* KEY_EN_BACKSPACE;
extern const char* KEY_EN_INSERT;
extern const char* KEY_EN_HOME;
extern const char* KEY_EN_PAGE_UP;
extern const char* KEY_EN_TAB;
extern const char* KEY_EN_Q;
extern const char* KEY_EN_W;
extern const char* KEY_EN_E;
extern const char* KEY_EN_R;
extern const char* KEY_EN_T;
extern const char* KEY_EN_Y;
extern const char* KEY_EN_U;
extern const char* KEY_EN_I;
extern const char* KEY_EN_O;
extern const char* KEY_EN_P;
extern const char* KEY_EN_LEFT_BRACKET;
extern const char* KEY_EN_RIGHT_BRACKET;
extern const char* KEY_EN_BACK_SLASH;
extern const char* KEY_EN_ANSI_BACK_SLASH;
extern const char* KEY_EN_DELETE;
extern const char* KEY_EN_END;
extern const char* KEY_EN_PAGE_DOWN;
extern const char* KEY_EN_CAPS_LOCK;
extern const char* KEY_EN_A;
extern const char* KEY_EN_S;
extern const char* KEY_EN_D;
extern const char* KEY_EN_F;
extern const char* KEY_EN_G;
extern const char* KEY_EN_H;
extern const char* KEY_EN_J;
extern const char* KEY_EN_K;
extern const char* KEY_EN_L;
extern const char* KEY_EN_SEMICOLON;
extern const char* KEY_EN_QUOTE;
extern const char* KEY_EN_POUND;
extern const char* KEY_EN_ANSI_ENTER;
extern const char* KEY_EN_ISO_ENTER;
extern const char* KEY_EN_LEFT_SHIFT;
extern const char* KEY_EN_ISO_BACK_SLASH;
extern const char* KEY_EN_Z;
extern const char* KEY_EN_X;
extern const char* KEY_EN_C;
extern const char* KEY_EN_V;
extern const char* KEY_EN_B;
extern const char* KEY_EN_N;
extern const char* KEY_EN_M;
extern const char* KEY_EN_COMMA;
extern const char* KEY_EN_PERIOD;
extern const char* KEY_EN_FORWARD_SLASH;
extern const char* KEY_EN_RIGHT_SHIFT;
extern const char* KEY_EN_UP_ARROW;
extern const char* KEY_EN_LEFT_CONTROL;
extern const char* KEY_EN_LEFT_WINDOWS;
extern const char* KEY_EN_LEFT_FUNCTION;
extern const char* KEY_EN_LEFT_ALT;
extern const char* KEY_EN_SPACE;
extern const char* KEY_EN_RIGHT_ALT;
extern const char* KEY_EN_RIGHT_FUNCTION;
extern const char* KEY_EN_RIGHT_WINDOWS;
extern const char* KEY_EN_MENU;
extern const char* KEY_EN_RIGHT_CONTROL;
extern const char* KEY_EN_LEFT_ARROW;
extern const char* KEY_EN_DOWN_ARROW;
extern const char* KEY_EN_RIGHT_ARROW;
extern const char* KEY_EN_NUMPAD_LOCK;
extern const char* KEY_EN_NUMPAD_DIVIDE;
extern const char* KEY_EN_NUMPAD_TIMES;
extern const char* KEY_EN_NUMPAD_MINUS;
extern const char* KEY_EN_NUMPAD_PLUS;
extern const char* KEY_EN_NUMPAD_PERIOD;
extern const char* KEY_EN_NUMPAD_ENTER;
extern const char* KEY_EN_NUMPAD_EQUAL;
extern const char* KEY_EN_NUMPAD_0;
extern const char* KEY_EN_NUMPAD_1;
extern const char* KEY_EN_NUMPAD_2;
extern const char* KEY_EN_NUMPAD_3;
extern const char* KEY_EN_NUMPAD_4;
extern const char* KEY_EN_NUMPAD_5;
extern const char* KEY_EN_NUMPAD_6;
extern const char* KEY_EN_NUMPAD_7;
extern const char* KEY_EN_NUMPAD_8;
extern const char* KEY_EN_NUMPAD_9;
extern const char* KEY_EN_MEDIA_PLAY_PAUSE;
extern const char* KEY_EN_MEDIA_PREVIOUS;
extern const char* KEY_EN_MEDIA_NEXT;
extern const char* KEY_EN_MEDIA_STOP;
extern const char* KEY_EN_MEDIA_MUTE;
extern const char* KEY_EN_MEDIA_VOLUME_DOWN;
extern const char* KEY_EN_MEDIA_VOLUME_UP;
extern const char* KEY_EN_F13;
extern const char* KEY_EN_F14;
extern const char* KEY_EN_F15;
extern const char* KEY_EN_F16;
extern const char* KEY_EN_F17;
extern const char* KEY_EN_F18;
extern const char* KEY_EN_F19;
extern const char* KEY_EN_F20;
extern const char* KEY_EN_F21;
extern const char* KEY_EN_F22;
extern const char* KEY_EN_F23;
extern const char* KEY_EN_F24;
extern const char* KEY_JP_RO;
extern const char* KEY_JP_EJ;
extern const char* KEY_JP_ZENKAKU;
extern const char* KEY_JP_KANA;
extern const char* KEY_JP_HENKAN;
extern const char* KEY_JP_MUHENKAN;
extern const char* KEY_JP_YEN;
extern const char* KEY_JP_AT;
extern const char* KEY_JP_CHEVRON;
extern const char* KEY_JP_COLON;
extern const char* KEY_JP_KATAKANA;
extern const char* KEY_JP_HIRAGANA;
extern const char* KEY_KR_HAN;
extern const char* KEY_KR_HANJA;
extern const char* KEY_NORD_AAL;
extern const char* KEY_NORD_A_OE;
extern const char* KEY_NORD_O_AE;
extern const char* KEY_NORD_HALF;
extern const char* KEY_NORD_HYPHEN;
extern const char* KEY_NORD_PLUS_QUESTION;
extern const char* KEY_NORD_ACUTE_GRAVE;
extern const char* KEY_NORD_DOTS_CARET;
extern const char* KEY_NORD_QUOTE;
extern const char* KEY_NORD_ANGLE_BRACKET;
extern const char* KEY_DE_ESZETT;
extern const char* KEY_DE_DIAERESIS_A;
extern const char* KEY_DE_DIAERESIS_O;
extern const char* KEY_DE_DIAERESIS_U;
extern const char* KEY_FR_SUPER_2;
extern const char* KEY_FR_AMPERSAND;
extern const char* KEY_FR_ACUTE_E;
extern const char* KEY_FR_DOUBLEQUOTE;
extern const char* KEY_FR_LEFT_PARENTHESIS;
extern const char* KEY_FR_GRAVE_E;
extern const char* KEY_FR_UNDERSCORE;
extern const char* KEY_FR_CEDILLA_C;
extern const char* KEY_FR_GRAVE_A;
extern const char* KEY_FR_RIGHT_PARENTHESIS;
extern const char* KEY_FR_DOLLAR;
extern const char* KEY_FR_GRAVE_U;
extern const char* KEY_FR_ASTERIX;
extern const char* KEY_FR_EXCLAIMATION;
extern const char* KEY_ES_OPEN_QUESTION_MARK;
extern const char* KEY_ES_TILDE;
extern const char* KEY_ES_ENIE;
extern const char* KEY_BR_TILDE;
+73
View File
@@ -0,0 +1,73 @@
/*---------------------------------------------------------*\
| RGBController_Dummy.cpp |
| |
| Dummy RGBController that can mimic various devices for |
| development and test purposes |
| |
| Adam Honse (CalcProgrammer1) 25 Feb 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include "RGBController_Dummy.h"
/**------------------------------------------------------------------*\
@name Dummy
@category Dummy
@type I2C or Serial or WMI or USB
@save :white_check_mark: or :robot: or :o: or :x:
@direct :white_check_mark: or :rotating_light: or :o: or :x:
@effects :white_check_mark: or :rotating_light: or :tools: or :o: or :x:
@detectors DetectDummy,DetectDummy2
@comment Insert multiline dummy comment here
| Symbol | Meaning |
| :---: | :--- |
| :white_check_mark: | Fully supported by OpenRGB |
| :rotating_light: | Support is problematic |
| :robot: | Feature is automatic and can not be turned off |
| :tools: | Partially supported by OpenRGB |
| :o: | Not currently supported by OpenRGB |
| :x: | Not applicable for this device |
*/
RGBController_Dummy::RGBController_Dummy()
{
}
void RGBController_Dummy::SetupZones()
{
}
void RGBController_Dummy::ResizeZone(int /*zone*/, int /*new_size*/)
{
}
void RGBController_Dummy::DeviceUpdateLEDs()
{
}
void RGBController_Dummy::UpdateZoneLEDs(int /*zone*/)
{
}
void RGBController_Dummy::UpdateSingleLED(int /*led*/)
{
}
void RGBController_Dummy::SetCustomMode()
{
}
void RGBController_Dummy::DeviceUpdateMode()
{
}
+32
View File
@@ -0,0 +1,32 @@
/*---------------------------------------------------------*\
| RGBController_Dummy.h |
| |
| Dummy RGBController that can mimic various devices for |
| development and test purposes |
| |
| Adam Honse (CalcProgrammer1) 25 Feb 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
class RGBController_Dummy : public RGBController
{
public:
RGBController_Dummy();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
};
+136
View File
@@ -0,0 +1,136 @@
/*---------------------------------------------------------*\
| RGBController_Network.cpp |
| |
| RGBController implementation that represents a remote |
| RGBController instance from a connected OpenRGB server |
| |
| Adam Honse (CalcProgrammer1) 11 Apr 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <cstring>
#include "RGBController_Network.h"
RGBController_Network::RGBController_Network(NetworkClient * client_ptr, unsigned int dev_idx_val)
{
client = client_ptr;
dev_idx = dev_idx_val;
}
void RGBController_Network::SetupZones()
{
//Don't send anything, this function should only process on host
}
void RGBController_Network::ClearSegments(int zone)
{
client->SendRequest_RGBController_ClearSegments(dev_idx, zone);
client->SendRequest_ControllerData(dev_idx);
client->WaitOnControllerData();
}
void RGBController_Network::AddSegment(int zone, segment new_segment)
{
unsigned char * data = GetSegmentDescription(zone, new_segment);
unsigned int size;
memcpy(&size, &data[0], sizeof(unsigned int));
client->SendRequest_RGBController_AddSegment(dev_idx, data, size);
delete[] data;
client->SendRequest_ControllerData(dev_idx);
client->WaitOnControllerData();
}
void RGBController_Network::ResizeZone(int zone, int new_size)
{
client->SendRequest_RGBController_ResizeZone(dev_idx, zone, new_size);
client->SendRequest_ControllerData(dev_idx);
client->WaitOnControllerData();
}
void RGBController_Network::DeviceUpdateLEDs()
{
unsigned char * data = GetColorDescription();
unsigned int size;
memcpy(&size, &data[0], sizeof(unsigned int));
client->SendRequest_RGBController_UpdateLEDs(dev_idx, data, size);
delete[] data;
}
void RGBController_Network::UpdateZoneLEDs(int zone)
{
unsigned char * data = GetZoneColorDescription(zone);
unsigned int size;
memcpy(&size, &data[0], sizeof(unsigned int));
client->SendRequest_RGBController_UpdateZoneLEDs(dev_idx, data, size);
delete[] data;
}
void RGBController_Network::UpdateSingleLED(int led)
{
unsigned char * data = GetSingleLEDColorDescription(led);
client->SendRequest_RGBController_UpdateSingleLED(dev_idx, data, sizeof(int) + sizeof(RGBColor));
delete[] data;
}
void RGBController_Network::SetCustomMode()
{
client->SendRequest_RGBController_SetCustomMode(dev_idx);
client->SendRequest_ControllerData(dev_idx);
client->WaitOnControllerData();
}
void RGBController_Network::DeviceUpdateMode()
{
unsigned char * data = GetModeDescription(active_mode, client->GetProtocolVersion());
unsigned int size;
memcpy(&size, &data[0], sizeof(unsigned int));
client->SendRequest_RGBController_UpdateMode(dev_idx, data, size);
delete[] data;
}
void RGBController_Network::DeviceSaveMode()
{
unsigned char * data = GetModeDescription(active_mode, client->GetProtocolVersion());
unsigned int size;
memcpy(&size, &data[0], sizeof(unsigned int));
client->SendRequest_RGBController_SaveMode(dev_idx, data, size);
delete[] data;
}
/*-----------------------------------------------------*\
| This function overrides RGBController::UpdateLEDs()! |
| Normally, UpdateLEDs() sets a flag for the updater |
| thread to update the device asynchronously, which |
| prevents delays updating local devices. This causes |
| instability and flickering with network devices though|
| so for the network implementation, process all updates|
| synchronously. |
\*-----------------------------------------------------*/
void RGBController_Network::UpdateLEDs()
{
DeviceUpdateLEDs();
}
+42
View File
@@ -0,0 +1,42 @@
/*---------------------------------------------------------*\
| RGBController_Network.h |
| |
| RGBController implementation that represents a remote |
| RGBController instance from a connected OpenRGB server |
| |
| Adam Honse (CalcProgrammer1) 11 Apr 2020 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include "RGBController.h"
#include "NetworkClient.h"
class RGBController_Network : public RGBController
{
public:
RGBController_Network(NetworkClient * client_ptr, unsigned int dev_idx_val);
void SetupZones();
void ClearSegments(int zone);
void AddSegment(int zone, segment new_segment);
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void SetCustomMode();
void DeviceUpdateMode();
void DeviceSaveMode();
void UpdateLEDs();
private:
NetworkClient * client;
unsigned int dev_idx;
};