Added Row and Column Mapping

Fixed Loudness Visual
This commit is contained in:
Maurice Grönwoldt 2021-02-20 20:19:21 +01:00
commit 238e22caf6
6 changed files with 384 additions and 44 deletions

View file

@ -3,6 +3,8 @@
#include <VulcanoLE/API/HIDHelper.h>
#define NUM_KEYS 144
#define NUM_ROWS 6
#define NUM_COLS 21
typedef struct rgba_type {
int16_t r{};
@ -23,7 +25,7 @@ typedef struct led_map_type {
class Vulcan121 {
public:
explicit Vulcan121(HIDHelper *helper);
~Vulcan121() = default;
~Vulcan121();
int send_led_map(led_map *src, bool deleteMap = false);
int send_led_to(rgba rgb);
bool send_init_sequence();
@ -32,17 +34,23 @@ public:
bool wait_for_ctrl_dev();
static led_map *createEmptyLEDMap();
struct DATA {
int num_rows = 6;
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 = { .r = 0x0000, .g = 0x0000, .b = 0x0000 };
keys *keyMapRow[6];
keys *keyMapCols[0]; // need to find out the count!
rgba rv_color_off = { 0x0000, 0x0000, 0x0000 };
keys *keyMapRow[NUM_ROWS];
keys *keyMapCol[NUM_COLS]; // need to find out the count!
};