Skip to content

Bluetooth Receiver: shuffle and repeat buttons that follow the phone's player - #197

Merged
bdbarnett merged 5 commits into
mainfrom
btreceiver-repeat-shuffle
Nov 20, 2026
Merged

bdbarnett merged 5 commits into
mainfrom
btreceiver-repeat-shuffle

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Bluetooth Receiver gets shuffle and repeat buttons above the volume slider. They show the phone's player modes and change them: tap shuffle to turn it on or off, and repeat to go from off to all tracks to one track, marked with a small 1. A button lights in the screen's accent colour while its mode is on, and follows the phone when you change it there. A phone that doesn't report its modes shows neither button, and the slider keeps its place.

The icons are iconkit's outline repeat and shuffle, tinted rather than filled.

This needs AudioSink.repeat, AudioSink.shuffle and the SETTINGS change bit from PyDevices/omnipython-builds#600. On firmware without them the app reads None and shows no buttons. The demo phone reports modes in its playing and paused states and none for the long title, and the contract test covers each case, taps included.

Tested on an ESP32-S31 4.3-inch board running main with #600, playing Spotify from a Samsung Galaxy S21. Taps on the board took repeat from off to all to one track and back to off, and turned shuffle on and off. Spotify's controls followed each tap. Changes made in Spotify reached the board within a few seconds, including shuffle from Spotify's Shuffle / Smart Shuffle sheet. The README now has a screenshot taken from that board's framebuffer, with the album cover blurred.

The board screenshot was taken with the hands-free work of #196 also running, so the phone's signal readout it showed is painted out here; this PR doesn't add it. The demo screenshots were made again from this branch. The contract test passes on CPython.

…s player

The phone's shuffle and repeat show above the volume, lit in the screen's
colour while on, and a tap changes them on the phone. Repeat steps from off
to all tracks to one track, marked with a small 1. A phone, or a firmware,
that doesn't report them shows neither, and the volume stays beside the
play button.

Checked with tests/btreceiver_contract.py on CPython and unix MicroPython:
the buttons' colours, the taps' effect on the demo phone, a change made on
the phone, and both hidden with a phone that doesn't report them.
Taken from the board's framebuffer while it played from a phone with shuffle and repeat on; the album cover is blurred.
…l readout

The signal and its No service note come from the hands-free link, which this app doesn't read yet; the AVRCP battery stays.
@bdbarnett
bdbarnett force-pushed the btreceiver-repeat-shuffle branch from 021ecd6 to 7c1160a Compare November 20, 2026 22:50
@bdbarnett
bdbarnett merged commit 60dbc5e into main Nov 20, 2026
14 checks passed
@bdbarnett
bdbarnett deleted the btreceiver-repeat-shuffle branch November 20, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant