v0.62.0: andTunes 0.4.0 — speakers (AirPlay, Chromecast), a list for a menu, icon pills, full-screen art
Now Playing: tap the art for it full screen, the title or artist line for its album; shuffle, repeat and a new speakers button are icon pills. The main menu is a list (Now Playing on top, Settings at the bottom, six rows to a screen). The speakers button lists this Rabbit plus every AirPlay speaker and Chromecast on the Wi-Fi: AirPlayRemote is the desktop's RAOP sender in Java (verified from the R1 against shairport-sync), CastRemote speaks the Cast protocol directly to the Default Media Receiver and serves the file over HTTP (not yet tried on a real Chromecast).
This commit is contained in:
+33
-7
@@ -46,9 +46,9 @@ Density is overridden to 160, so an app sees a 480 × 640 **dp** canvas — but
|
||||
the panel is 2.88", about 278 real ppi. **One dp is roughly half its usual
|
||||
physical size here.** A stock 48 dp list row is 4.4 mm tall and unusable.
|
||||
|
||||
> **Rule: double every stock dp value.** Body text 28–32 sp, list rows ≥ 88 dp,
|
||||
> menu tiles ~213 dp. A 2 × 3 grid gives six 240 × 213 dp buttons, ≈ 22 × 19 mm
|
||||
> each.
|
||||
> **Rule: double every stock dp value.** Body text 28–32 sp, list rows ≥ 88 dp.
|
||||
> The main menu (a list since v0.4.0) sizes its rows so exactly six fill the
|
||||
> space the status and navigation bars leave, ≈ 84 dp each.
|
||||
|
||||
Do **not** "fix" this by changing the device's density. trav has it where he
|
||||
wants it and asked for it to be left alone.
|
||||
@@ -160,9 +160,34 @@ Target: menu visible in **under 400 ms**.
|
||||
`library.json`, which isn't media — that's the whole reason. Fallback if it
|
||||
turns out to be blocked: a one-time SAF folder pick.
|
||||
- **Screens are activities**, so "the last screen we were at" is Android's own
|
||||
back stack with no bookkeeping. `MenuActivity` (six tiles, loads nothing),
|
||||
one generic `ListActivity` parameterised for every list in the spec,
|
||||
`NowPlayingActivity`, and a foreground `PlaybackService`.
|
||||
back stack with no bookkeeping. `MenuActivity` (a list, loads nothing:
|
||||
Now Playing / Shuffle All on top, Settings at the bottom), one generic
|
||||
`ListActivity` parameterised for every list in the spec,
|
||||
`NowPlayingActivity` (tap the art for it full screen, the title for its
|
||||
album; shuffle · repeat · speakers as icon pills), `SettingsActivity`
|
||||
(version and library so far), and a foreground `PlaybackService`.
|
||||
- **Speakers** (v0.4.0, `SpeakersActivity`): the speakers pill lists this
|
||||
Rabbit and every AirPlay speaker (`_raop._tcp`) and Chromecast
|
||||
(`_googlecast._tcp`) NsdManager finds, resolved one at a time (Android 13
|
||||
refuses a second concurrent resolve). Picking one hands the queue to a
|
||||
`Remote`; `PlaybackService` keeps queue, shuffle, repeat and play counts
|
||||
either way, holds a wake + Wi-Fi lock while one is connected, and going
|
||||
back to the Rabbit leaves it *paused*. The wheel drives the speaker's
|
||||
volume. No SDKs, by the same rule as everything else:
|
||||
- `CastRemote` speaks the Cast protocol itself (TLS :8009, length-prefixed
|
||||
protobuf `CastMessage` frames — encoded by hand, checked byte-identical
|
||||
to pychromecast's — with JSON payloads), launches the Default Media
|
||||
Receiver and hands it a URL on `MediaServer`, a token-only HTTP server
|
||||
with Range, so the speaker fetches the original file (the desktop's
|
||||
media-receiver model). **Untested on a real Chromecast so far.**
|
||||
- `AirPlayRemote` is the desktop's `airplay/raop.py` in Java (libraop's
|
||||
RAOP behaviour: auth-setup, AppleLossless, RECORD with RTP-Info, a 2 s
|
||||
buffer, NTP-locked timestamps, timing responder, resends), decoding with
|
||||
MediaExtractor + MediaCodec to 44.1 kHz stereo and sending uncompressed
|
||||
ALAC (byte-identical to `support.alac_verbatim`). Verified from the R1
|
||||
against shairport-sync: the receiver's output matched the song.
|
||||
- `Music/andTunes/speakers.txt` lists speakers by address for when mDNS
|
||||
can't see them: `airplay|cast <host> [port] [name]` per line.
|
||||
- **No back button on the now-playing screen** — Android's own is always on
|
||||
screen and the panel is tiny (trav's call).
|
||||
- **End of a queue pauses.** It does not roll into shuffle-all. Repeat is
|
||||
@@ -183,7 +208,8 @@ authority and `manifest.py` for the exact rows.
|
||||
Media/<Artist>/<Album>/04 Song.mp3
|
||||
Art/<8-hex album key>.jpg 480 px, one per album
|
||||
Playlists/<Name>.m3u entries are ../Media/… relative paths
|
||||
Buttons/*.png the user's own menu artwork — app reads only
|
||||
Buttons/*.png the user's own button artwork — app reads only
|
||||
speakers.txt optional: speakers by address (see Speakers)
|
||||
plays/andtunes-<installid>.json the app writes counts back here (phase 3)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user