Features Wishlist
Back to the player's card when a tap in the library starts playing
What happens
I tap a playlist in the media library. It starts playing and is marked, but the library stays open on the list, so I cannot see what plays. Twice Back gets me to the player's card.
What I want
When the player starts the tapped item, the library closes and the player's card is back: cover, title, time, keys and volume. Only the library closes. The card stays open, and the screen does not go to page 1.
Where
components/smart_display/media_library.cpp, updated():
if (starting && t && (t->state == "playing" || t->state == "paused") && t->supported & tile_controls::feature::MEDIA_PLAY_MEDIA) {
Call media_library::close() there, after marked = starting; starting = 0; remark();
Constraints
- Not hide_detail() and not go_home(): both close the card and go to page 1. auto_home does the same, so a shorter auto_home_seconds is not this.
- Do not delete LVGL objects inside the state update. Close on the loop's next pass, as open_page and go_home do with delay: 0ms.
- paused counts, so resuming a paused track closes the library too. That is intended.
- A start that never plays must leave the library open. tick() already clears starting after STARTING_MS.
- Put the yes or no in the header beside updated(), so tests/test_media_library.cpp can prove it: that header is the part a PC tests.
- If it becomes a setting: a key in SETTING_RULES (app), the row in settings_screen.h, the entity in SETTING_ENTITIES, and the key in SETTINGS_BESIDE_BLOCK, since firmware before 0.2.44 refuses a wider settings block.
Test
On a 480x480: tap a playlist and the card returns with the track playing; tap one that never starts and the library stays open; resume a paused track and it closes; wait for auto_home and it still goes to page 1 as before.
Setup
Guition 4 inch (480x480), app 0.4.98, firmware 0.61.0, a Music Assistant player (Spotify through Music Assistant) in Home Assistant. Related: #123 is the library's content, not this.
Discussion 0
Add a commentStart the conversation
Share an example, ask a question or explain how you would use this.