VulcanoLE/headers/VulcanoLE/Keyboards/Vulcan121.h

49 lines
1.2 KiB
C++

#pragma once
#include <VulcanoLE/API/HIDHelper.h>
#define NUM_KEYS 144
typedef struct rgba_type {
int16_t r{};
int16_t g{};
int16_t b{};
int16_t a = 255;
} rgba;
typedef struct subArray {
int count = 0;
int *index = nullptr; // will init in code! and returned
} keys;
typedef struct led_map_type {
rgba key[NUM_KEYS];
} led_map;
class Vulcan121 {
public:
explicit Vulcan121(HIDHelper *helper);
~Vulcan121() = default;
int send_led_map(led_map *src, bool deleteMap = false);
int send_led_to(rgba rgb);
bool send_init_sequence();
bool query_ctrl_report(unsigned char);
bool send_ctrl_report(unsigned char id);
bool wait_for_ctrl_dev();
static led_map *createEmptyLEDMap();
struct DATA {
int num_rows = 6;
int num_keys = 144;
};
int getColumnsForRow(int row);
int getRowsForColumns(int col);
int getIndex(int row, int col);
protected:
// we need some mapping feature! rows and cols dont have the same amount of keys. so the struct needs
HIDHelper *m_helper;
rgba *rv_fixed[NUM_KEYS]{};
rgba rv_color_off = { .r = 0x0000, .g = 0x0000, .b = 0x0000 };
keys *keyMapRow[6];
keys *keyMapCols[0]; // need to find out the count!
};