|
TB2026-YDS Firmware
|
Audio settings: output routing (top) and an L/R balance slider (bottom). More...
#include "audio_settings.h"#include "bluetooth_settings.h"#include "navigator.h"#include "status_bar.h"#include "gfx.h"#include "player.h"#include "volume.h"#include "bluetooth.h"#include <stdio.h>#include <stdlib.h>Macros | |
| #define | CONTENT_TOP (STATUS_BAR_H) |
| #define | CONTENT_BOT (GFX_H) |
| #define | MID_Y ((CONTENT_TOP + CONTENT_BOT) / 2) /* separator, at the middle */ |
| #define | ROW_H 16 |
| #define | CARET_X 4 |
| #define | LABEL_X 16 |
| #define | DOT_X (GFX_W - 14) /* active-output marker, right-aligned */ |
| #define | OUT_GROUP_H (16 + 3 * ROW_H) |
| #define | OUT_HDR_Y (CONTENT_TOP + ((MID_Y - CONTENT_TOP) - OUT_GROUP_H) / 2) |
| #define | ROW0_Y (OUT_HDR_Y + 16) /* first output row */ |
| #define | SEP_Y MID_Y /* separator between the two sections */ |
| #define | BAL_GROUP_H 50 |
| #define | BAL_HDR_Y (MID_Y + ((CONTENT_BOT - MID_Y) - BAL_GROUP_H) / 2) |
| #define | BAR_X 18 |
| #define | BAR_W 140 |
| #define | BAR_Y (BAL_HDR_Y + 24) |
| #define | BAR_H 6 |
| #define | VAL_Y (BAR_Y + 18) /* numeric readout under the bar */ |
| #define | ACCENT gfx_rgb(255, 0, 0) /* Settings identity colour (see root_menu) */ |
| #define | DIM gfx_rgb(110, 110, 110) |
| #define | BAL_MAX 40 /* 40 steps * 0.5 dB = +20 dB per side */ |
Enumerations | |
| enum | { SEL_JACK = 0 , SEL_BT , SEL_BT_SETTINGS , SEL_SLIDER , N_SEL } |
Functions | |
| screen_t * | audio_settings_screen (void) |
| Get the singleton Audio settings screen, ready to push onto the navigator. | |
Audio settings: output routing (top) and an L/R balance slider (bottom).
Two stacked sections below the status bar, like the Bluetooth screen. The top mirrors the Now-Playing output popup (Jack / Bluetooth / BT Settings) but in the Settings red accent, and applies the choice in place – the active output keeps its filled dot, the Bluetooth row is dimmed and inert while nothing is connected. The bottom is a centred balance slider: pushing it left makes the LEFT channel louder, right the RIGHT one, up to +20 dB per side.
The slider drives the DAC L/R trim live (volume_set_balance) for immediate feedback; the value is persisted to NVS once, on screen exit (volume_save_balance), and restored by volume_init at boot – so a still slider costs no flash writes.
| #define ACCENT gfx_rgb(255, 0, 0) /* Settings identity colour (see root_menu) */ |
| #define BAL_GROUP_H 50 |
| #define BAL_HDR_Y (MID_Y + ((CONTENT_BOT - MID_Y) - BAL_GROUP_H) / 2) |
| #define BAL_MAX 40 /* 40 steps * 0.5 dB = +20 dB per side */ |
| #define BAR_H 6 |
| #define BAR_W 140 |
| #define BAR_X 18 |
| #define BAR_Y (BAL_HDR_Y + 24) |
| #define CARET_X 4 |
| #define CONTENT_BOT (GFX_H) |
| #define CONTENT_TOP (STATUS_BAR_H) |
| #define DIM gfx_rgb(110, 110, 110) |
| #define DOT_X (GFX_W - 14) /* active-output marker, right-aligned */ |
| #define LABEL_X 16 |
| #define MID_Y ((CONTENT_TOP + CONTENT_BOT) / 2) /* separator, at the middle */ |
| #define OUT_GROUP_H (16 + 3 * ROW_H) |
| #define OUT_HDR_Y (CONTENT_TOP + ((MID_Y - CONTENT_TOP) - OUT_GROUP_H) / 2) |
| #define ROW0_Y (OUT_HDR_Y + 16) /* first output row */ |
| #define ROW_H 16 |
| #define SEP_Y MID_Y /* separator between the two sections */ |
| #define VAL_Y (BAR_Y + 18) /* numeric readout under the bar */ |
| screen_t * audio_settings_screen | ( | void | ) |
Get the singleton Audio settings screen, ready to push onto the navigator.