TB2026-YDS Firmware
Loading...
Searching...
No Matches
output_select.c File Reference

Output-selection popup: route audio to the Jack or a Bluetooth speaker. More...

#include "output_select.h"
#include "bluetooth_settings.h"
#include "navigator.h"
#include "gfx.h"
#include "player.h"
#include "volume.h"
#include "bluetooth.h"

Macros

#define BOX_W   148
#define BOX_H   84
#define BOX_X   ((GFX_W - BOX_W) / 2)
#define BOX_Y   ((GFX_H - BOX_H) / 2)
#define TITLE_Y   (BOX_Y + 6)
#define ROW0_Y   (BOX_Y + 26)
#define ROW_H   20
#define CARET_X   (BOX_X + 8)
#define LABEL_X   (BOX_X + 20)
#define DOT_X   (BOX_X + BOX_W - 14) /* active-output marker, right-aligned */
#define ACCENT   gfx_rgb(0, 100, 255) /* Music identity colour (see root_menu) */
#define DIM   gfx_rgb(110, 110, 110)
#define N_ROWS   3

Functions

screen_toutput_select_screen (void)
 Get the singleton output-selection popup, ready to push onto the navigator.

Detailed Description

Output-selection popup: route audio to the Jack or a Bluetooth speaker.

A small centered box (drawn over black) reached from Now Playing (UP). Three rows: the wired Jack, a Bluetooth speaker, and a shortcut into the Bluetooth settings screen. The Bluetooth row is dimmed and inert while no device is connected. Selecting an output calls the single routing entry point player_set_output(), which re-routes a live stream and powers the unused path down itself – so this screen only expresses the choice, it does not touch hardware.

A Bluetooth switch is refused only when no speaker is connected (the row is dimmed); an un-acked speaker volume does not refuse it — the player defers the stream until the ack (never blast) and the switch call still succeeds.

Note
Développé avec l'assistance de Claude Opus 4.8 (Anthropic), sous la direction de Y. Dos Santos : spécification, revue et validation sur cible par l'auteur.

Macro Definition Documentation

◆ ACCENT

#define ACCENT   gfx_rgb(0, 100, 255) /* Music identity colour (see root_menu) */

◆ BOX_H

#define BOX_H   84

◆ BOX_W

#define BOX_W   148

◆ BOX_X

#define BOX_X   ((GFX_W - BOX_W) / 2)

◆ BOX_Y

#define BOX_Y   ((GFX_H - BOX_H) / 2)

◆ CARET_X

#define CARET_X   (BOX_X + 8)

◆ DIM

#define DIM   gfx_rgb(110, 110, 110)

◆ DOT_X

#define DOT_X   (BOX_X + BOX_W - 14) /* active-output marker, right-aligned */

◆ LABEL_X

#define LABEL_X   (BOX_X + 20)

◆ N_ROWS

#define N_ROWS   3

◆ ROW0_Y

#define ROW0_Y   (BOX_Y + 26)

◆ ROW_H

#define ROW_H   20

◆ TITLE_Y

#define TITLE_Y   (BOX_Y + 6)

Function Documentation

◆ output_select_screen()

screen_t * output_select_screen ( void )

Get the singleton output-selection popup, ready to push onto the navigator.

Returns
Pointer to the output-selection screen.