mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
add BT display (still WIP)
This commit is contained in:
@@ -100,10 +100,8 @@ static void sink_data_handler(const uint8_t *data, uint32_t len)
|
||||
* BT sink command handler
|
||||
*/
|
||||
|
||||
static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, ...)
|
||||
static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, va_list args)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
// don't LOCK_O as there is always a chance that LMS takes control later anyway
|
||||
if (output.external != DECODE_BT && output.state > OUTPUT_STOPPED) {
|
||||
LOG_WARN("Cannot use BT sink while LMS/AirPlay is controlling player");
|
||||
@@ -112,8 +110,6 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, ...)
|
||||
|
||||
LOCK_D;
|
||||
|
||||
va_start(args, cmd);
|
||||
|
||||
if (cmd != BT_SINK_VOLUME) LOCK_O;
|
||||
|
||||
switch(cmd) {
|
||||
@@ -152,13 +148,14 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, ...)
|
||||
volume = 65536 * powf(volume / 128.0f, 3);
|
||||
set_volume(volume, volume);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd != BT_SINK_VOLUME) UNLOCK_O;
|
||||
UNLOCK_D;
|
||||
|
||||
va_end(args);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ static void send_server(void) {
|
||||
static void server(in_addr_t ip, u16_t hport, u16_t cport) {
|
||||
char msg[32];
|
||||
sprintf(msg, "%s:%hu", inet_ntoa(ip), hport);
|
||||
display->text(DISPLAY_FONT_DEFAULT, DISPLAY_CENTER, DISPLAY_CLEAR | DISPLAY_UPDATE, msg);
|
||||
display->text(DISPLAY_FONT_DEFAULT, DISPLAY_CENTERED, DISPLAY_CLEAR | DISPLAY_UPDATE, msg);
|
||||
if (notify_chain) (*notify_chain)(ip, hport, cport);
|
||||
}
|
||||
|
||||
@@ -290,8 +290,8 @@ static void show_display_buffer(char *ddram) {
|
||||
|
||||
LOG_INFO("\n\t%.40s\n\t%.40s", line1, line2);
|
||||
|
||||
display->text(DISPLAY_FONT_DEFAULT, DISPLAY_TOP_LEFT, DISPLAY_CLEAR, line1);
|
||||
display->text(DISPLAY_FONT_DEFAULT, DISPLAY_BOTTOM_LEFT, DISPLAY_UPDATE, line2);
|
||||
display->line(1, DISPLAY_LEFT, DISPLAY_CLEAR, line1);
|
||||
display->line(2, DISPLAY_LEFT, DISPLAY_CLEAR | DISPLAY_UPDATE, line2);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user