VulcanoLE/headers/VulcanoLE/Keyboards/Vulcan121.h

57 lines
1.5 KiB
C++

#pragma once
#include <VulcanoLE/API/HIDHelper.h>
#define NUM_KEYS 144
#define NUM_ROWS 6
#define NUM_COLS 21
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();
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 = NUM_ROWS;
int num_cols = NUM_COLS;
int num_keys = 144;
};
int getColumnsForRow(int row);
int getRowsForColumns(int col);
const keys * getColumn(int col);
const keys * getRow(int row);
int getIndex(int row, int col);
// PLEASE MAKE SURE YOU KNOW THE LIMITS!
int getIndexNoCheck(int row, int col);
protected:
void setupMap();
// 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 = { 0x0000, 0x0000, 0x0000 };
keys *keyMapRow[NUM_ROWS];
keys *keyMapCol[NUM_COLS]; // need to find out the count!
};