#include "devdetails.h" #include "functions.h" #include #include #include #include #include // #include // #include #include #include #include "util.h" #define IMAGE_REPORT_LENGTH 8191 /* may or may not use these. Might use enumerations */ // #define STREAMDECK_ORIG 1 // #define STREAMDECK_MINI 2 struct Image { void* data; size_t size; }; struct Key { bool isFolder; void* command; struct Image* key; pthread_mutex_t key_mutex; }; /* How should we deal with invalid keys with nothing? Well we can use * a bitmask */ /* * Keys are numbered left to right. * so in the mini streamdeck we have * 0 1 2 * 3 4 5 */ struct Screen { struct Key* keys; }; struct Handler { hid_device* handler; }; struct Streamdeck { struct Handler* hid_handle; void* callback_funcs; struct Screen* curr_screen; int numkeys; int devicetype; }; typedef struct Image image; typedef struct Key key; typedef struct Screen screen; typedef struct Streamdeck streamdeck; typedef struct Handler handler; streamdeck* connect(); int reset(handler* deck); int resetkeystream(handler* deck); int callback(handler* deck, void* key, void* state); int readhandler(handler* deck); int set_key_image(streamdeck* deck, int key, image* img); int init (); void destroy_streamdeck (streamdeck* target); handler* create_hid_handler (); void clean_exit (); int set_brightness (streamdeck* deck, int new_level); // handler* create_hid_handler ();