Files
OpenRGB/Controllers/MountainKeyboardController/RGBController_MountainKeyboard.h
Adam Honse f948d6e1d3 Clean up some stuff in the Mountain keyboard controllers that violated conventions
* Mountain60KeyboardController's detector was setting the name member directly, this is an outdated convention that breaks the RGBController rework, moved to a Controller member
    * Mountain60KeyboardController had some sort of HID redetect logic, this should not be part of the Controller, this will be handled in the future by HID hotplugging
    * Both MountainKeyboardControllers defined static variables to keep track of current mode, moved these to class members so that they won't conflict if two instances exist
    * Don't send any device updates as part of SetupZones
2026-01-11 03:41:52 -06:00

62 lines
2.3 KiB
C++

/*---------------------------------------------------------*\
| RGBController_MountainKeyboard.h |
| |
| RGBController for Mountain keyboard |
| |
| Wojciech Lazarski Jan 2023 |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#pragma once
#include <cstring>
#include "RGBController.h"
#include "MountainKeyboardController.h"
#define MOUNTAIN_KEYBOARD_BRIGHTNESS_MIN 0
#define MOUNTAIN_KEYBOARD_BRIGHTNESS_MAX 100
#define MOUNTAIN_KEYBOARD_SPEED_MIN 0
#define MOUNTAIN_KEYBOARD_SPEED_MAX 4
#define MOUNTAIN_KEYBOARD_SPEED_DEFAULT 3
enum
{
MOUNTAIN_KEYBOARD_MODE_DIRECT = MOUNTAIN_KEYBOARD_IDX_CUSTOM,
MOUNTAIN_KEYBOARD_MODE_STATIC = MOUNTAIN_KEYBOARD_IDX_STATIC,
MOUNTAIN_KEYBOARD_MODE_COLOR_WAVE = MOUNTAIN_KEYBOARD_IDX_COLOR_WAVE,
MOUNTAIN_KEYBOARD_MODE_TORNADO = MOUNTAIN_KEYBOARD_IDX_TORNADO,
MOUNTAIN_KEYBOARD_MODE_BREATHING = MOUNTAIN_KEYBOARD_IDX_BREATHING,
MOUNTAIN_KEYBOARD_MODE_REACTIVE = MOUNTAIN_KEYBOARD_IDX_REACTIVE,
MOUNTAIN_KEYBOARD_MODE_MATRIX = MOUNTAIN_KEYBOARD_IDX_MATRIX,
MOUNTAIN_KEYBOARD_MODE_OFF = MOUNTAIN_KEYBOARD_IDX_OFF
};
class RGBController_MountainKeyboard : public RGBController
{
public:
RGBController_MountainKeyboard(MountainKeyboardController* controller_ptr);
~RGBController_MountainKeyboard();
void SetupZones();
void ResizeZone(int zone, int new_size);
void DeviceUpdateLEDs();
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
MountainKeyboardController* controller;
int prv_mode;
unsigned char wheel_color[3];
unsigned char ConvertDirection(unsigned int direction, bool rotation);
void DeviceUpdate(const mode& current_mode);
};