mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 21:47:04 +03:00
Start of 5.X work
This commit is contained in:
@@ -9,27 +9,28 @@
|
||||
#pragma once
|
||||
|
||||
#include "buttons.h"
|
||||
#include "Buttons.pb.h"
|
||||
|
||||
// BEWARE: this is the index of the array of action below (change actrls_action_s as well!)
|
||||
typedef enum { ACTRLS_NONE = -1, ACTRLS_POWER, ACTRLS_VOLUP, ACTRLS_VOLDOWN, ACTRLS_TOGGLE, ACTRLS_PLAY,
|
||||
ACTRLS_PAUSE, ACTRLS_STOP, ACTRLS_REW, ACTRLS_FWD, ACTRLS_PREV, ACTRLS_NEXT,
|
||||
BCTRLS_UP, BCTRLS_DOWN, BCTRLS_LEFT, BCTRLS_RIGHT,
|
||||
BCTRLS_PS0,BCTRLS_PS1,BCTRLS_PS2,BCTRLS_PS3,BCTRLS_PS4,BCTRLS_PS5,BCTRLS_PS6,BCTRLS_PS7,BCTRLS_PS8,BCTRLS_PS9,
|
||||
KNOB_LEFT, KNOB_RIGHT, KNOB_PUSH,
|
||||
ACTRLS_SLEEP,
|
||||
ACTRLS_REMAP, ACTRLS_MAX
|
||||
} actrls_action_e;
|
||||
// typedef enum { ACTRLS_NONE = -1, ACTRLS_POWER, ACTRLS_VOLUP, ACTRLS_VOLDOWN, ACTRLS_TOGGLE, ACTRLS_PLAY,
|
||||
// ACTRLS_PAUSE, ACTRLS_STOP, ACTRLS_REW, ACTRLS_FWD, ACTRLS_PREV, ACTRLS_NEXT,
|
||||
// BCTRLS_UP, BCTRLS_DOWN, BCTRLS_LEFT, BCTRLS_RIGHT,
|
||||
// BCTRLS_PS0,BCTRLS_PS1,BCTRLS_PS2,BCTRLS_PS3,BCTRLS_PS4,BCTRLS_PS5,BCTRLS_PS6,BCTRLS_PS7,BCTRLS_PS8,BCTRLS_PS9,
|
||||
// KNOB_LEFT, KNOB_RIGHT, KNOB_PUSH,
|
||||
// ACTRLS_SLEEP,
|
||||
// ACTRLS_REMAP, ACTRLS_MAX
|
||||
// } actrls_action_e;
|
||||
|
||||
typedef void (*actrls_handler)(bool pressed);
|
||||
typedef actrls_handler actrls_t[ACTRLS_MAX - ACTRLS_NONE - 1];
|
||||
typedef bool actrls_hook_t(int gpio, actrls_action_e action, button_event_e event, button_press_e press, bool long_press);
|
||||
typedef actrls_handler actrls_t[sys_btns_actions_MAX- sys_btns_actions_A_NONE - 1];
|
||||
typedef bool actrls_hook_t(int gpio, sys_btns_action *action, button_event_e event, button_press_e press, bool long_press);
|
||||
typedef bool actrls_ir_handler_t(uint16_t addr, uint16_t cmd);
|
||||
|
||||
// BEWARE any change to struct below must be mapped to actrls_config_map
|
||||
typedef struct {
|
||||
actrls_action_e action;
|
||||
const char * name;
|
||||
} actrls_action_detail_t;
|
||||
// typedef struct {
|
||||
// actrls_action_e action;
|
||||
// const char * name;
|
||||
// } actrls_action_detail_t;
|
||||
typedef struct actrl_config_s {
|
||||
int gpio;
|
||||
int type;
|
||||
@@ -37,7 +38,7 @@ typedef struct actrl_config_s {
|
||||
int debounce;
|
||||
int long_press;
|
||||
int shifter_gpio;
|
||||
actrls_action_detail_t normal[2], longpress[2], shifted[2], longshifted[2]; // [0] keypressed, [1] keyreleased
|
||||
sys_btns_press normal, longpress, shifted, longshifted; // [0] keypressed, [1] keyreleased
|
||||
} actrls_config_t;
|
||||
|
||||
esp_err_t actrls_init(const char *profile_name);
|
||||
|
||||
Reference in New Issue
Block a user