add Preset editor#896
Open
tmalch wants to merge 3 commits into
Open
Conversation
Decouples the playlist picker from the Alarm model so it can be reused by other callers that need to pick a playlist/favorite by URL, such as the upcoming preset editor.
Lets the user assign favorites to the player's preset buttons, mirroring the presets editor of the LMS web interface. Reads presets from the "preset_data" field of the status response and writes them via the "jivefavorites set_preset" command. Items without a URL (e.g. "Use current playlist") are excluded from the picker since a preset requires one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a Presets Editor to Squeezer so presets can be viewed and assigned from the
app, mirroring the web editor. It reuses parts of the Alarm settings view.
Disclosure: This is my first ever android code, it is mainly written by AI. I reviewed it and the changes seem reasonable.
Request for review, comments and merge. Thanks!
What it adds
PresetsActivity): shows the 6 preset slots for the active player,each with its current assignment and a play button to test it. Tap
a slot to assign a favorite/playlist from the same categorized picker used by the
alarm playlist screen. Reachable from the Now Playing overflow menu and from
Home > Settings, next to Alarms.
statusrequestalready includes
menu:menu, which makes the server returnpreset_data— this waspreviously received but ignored. No new request needed.
jivefavorites set_presetcommand (the same one the webeditor and SqueezePlay-based players use).
AlarmPlaylistActivityand its twoadapters) took an
Alarmpurely to read itsplayListIdfor highlighting the currentselection. Generalized it to take a plain URL string so both alarms and presets can
share it.
Open
reuses server-string tokens (e.g.
PRESETS_NOT_DEFINED) pulled verbatim from LMS's owntranslations via
updateSlimStrings. In English, German these translate to "preset" literally (German "Voreinstellung"),while the existing, independently translated home-screen widget strings (
remote_presetNDescription)call the same buttons "favorite" instead (German "Favoritentaste").