mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-27 12:50:49 +03:00
display support + extra generic buttons
This commit is contained in:
@@ -69,12 +69,35 @@ static void lms_next(void) {
|
||||
cli_send_cmd("button fwd");
|
||||
}
|
||||
|
||||
static void lms_up(void) {
|
||||
cli_send_cmd("button arrow_up");
|
||||
}
|
||||
|
||||
static void lms_down(void) {
|
||||
cli_send_cmd("button arrow_down");
|
||||
}
|
||||
|
||||
static void lms_left(void) {
|
||||
cli_send_cmd("button arrow_left");
|
||||
}
|
||||
|
||||
static void lms_right(void) {
|
||||
cli_send_cmd("button arrow_right");
|
||||
}
|
||||
|
||||
static void lms_push(void) {
|
||||
cli_send_cmd("button knob_push");
|
||||
}
|
||||
|
||||
const actrls_t LMS_controls = {
|
||||
lms_volume_up, lms_volume_down, // volume up, volume down
|
||||
lms_toggle, lms_play, // toggle, play
|
||||
lms_pause, lms_stop, // pause, stop
|
||||
lms_rew, lms_fwd, // rew, fwd
|
||||
lms_prev, lms_next, // prev, next
|
||||
lms_push,
|
||||
lms_up, lms_down,
|
||||
lms_left, lms_right,
|
||||
};
|
||||
|
||||
/****************************************************************************************
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#define OUTPUT_THREAD_STACK_SIZE 6 * 1024
|
||||
#define IR_THREAD_STACK_SIZE 6 * 1024
|
||||
|
||||
//#define BASE_CAP "Model=squeezelite,AccuratePlayPoints=0,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
|
||||
#define BASE_CAP "Model=squeezeesp32,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=" VERSION
|
||||
#define EXT_BSS __attribute__((section(".ext_ram.bss")))
|
||||
|
||||
typedef int16_t s16_t;
|
||||
@@ -47,6 +47,7 @@ void embedded_init(void);
|
||||
void register_external(void);
|
||||
void deregister_external(void);
|
||||
void decode_resume(int external);
|
||||
void vfd_data(u8_t *data, int len);
|
||||
|
||||
void (*server_notify)(in_addr_t ip, u16_t hport, u16_t cport);
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ static sockfd sock = -1;
|
||||
static in_addr_t slimproto_ip = 0;
|
||||
static u16_t slimproto_hport = 9000;
|
||||
static u16_t slimproto_cport = 9090;
|
||||
static u8_t player_id = 100; // squeezeesp32
|
||||
|
||||
extern struct buffer *streambuf;
|
||||
extern struct buffer *outputbuf;
|
||||
@@ -136,7 +137,7 @@ static void sendHELO(bool reconnect, const char *fixed_cap, const char *var_cap,
|
||||
memset(&pkt, 0, sizeof(pkt));
|
||||
memcpy(&pkt.opcode, "HELO", 4);
|
||||
pkt.length = htonl(sizeof(struct HELO_packet) - 8 + strlen(base_cap) + strlen(fixed_cap) + strlen(var_cap));
|
||||
pkt.deviceid = 12; // squeezeplay
|
||||
pkt.deviceid = player_id;
|
||||
pkt.revision = 0;
|
||||
packn(&pkt.wlan_channellist, reconnect ? 0x4000 : 0x0000);
|
||||
packN(&pkt.bytes_received_H, (u64_t)status.stream_bytes >> 32);
|
||||
@@ -444,6 +445,16 @@ static void process_audg(u8_t *pkt, int len) {
|
||||
set_volume(audg->adjust ? audg->gainL : FIXED_ONE, audg->adjust ? audg->gainR : FIXED_ONE);
|
||||
}
|
||||
|
||||
static void process_dsco(u8_t *pkt, int len) {
|
||||
LOG_INFO("got DSCO, switching from id %u to 12", (int) player_id);
|
||||
player_id = 12;
|
||||
}
|
||||
|
||||
static void process_vfdc(u8_t *pkt, int len) {
|
||||
LOG_DEBUG("VFDC %u", len);
|
||||
vfd_data( pkt + 4, len - 4);
|
||||
}
|
||||
|
||||
static void process_setd(u8_t *pkt, int len) {
|
||||
struct setd_packet *setd = (struct setd_packet *)pkt;
|
||||
|
||||
@@ -519,6 +530,8 @@ static struct handler handlers[] = {
|
||||
{ "audg", process_audg },
|
||||
{ "setd", process_setd },
|
||||
{ "serv", process_serv },
|
||||
{ "dsco", process_dsco },
|
||||
{ "vfdc", process_vfdc },
|
||||
{ "", NULL },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user