Skip to content

Music: Redesign Part 2#2337

Open
tituscmd wants to merge 63 commits into
InfiniTimeOrg:mainfrom
InfiniBros:music_redesign_2
Open

Music: Redesign Part 2#2337
tituscmd wants to merge 63 commits into
InfiniTimeOrg:mainfrom
InfiniBros:music_redesign_2

Conversation

@tituscmd

@tituscmd tituscmd commented Jul 26, 2025

Copy link
Copy Markdown
Contributor

Hey everybody,

Since creating PR #2292 and introducing a small little redesign of the music app, I've had some more time on my hands and finally came around to creating a better version of it.

I've moved the artist and track name up a bit to add a new progress bar that shows the progress of the song you're listening to, with the time that has passed shown on the left and the time remaining shown on the right.
Sadly, I've had to remove (comment out) the disc animation in the top right because of space issues. If anyone is especially fond of the disc I'm sure space can be made to fit it back in. It is definitely not a final decision by me, hence why it's only commented out and not removed altogether.
But now that I've temporarily removed the disc animation, the top of the screen seemed quite empty to me. And after some thinking and digging through the code, I stumbled upon these lines of code in the Music.cpp:

294 - // Let's assume it starts playing instantly
295 - // TODO: In the future should check for BT connection for better UX

And so I thought "why not do that?" and I added an indicator text at the top telling you if you are connected via bluetooth. Please share your opinion on this.

Finally, here are some pictures of it all:
WhatsApp Image 2025-12-28 at 01 30 44
Screenshot 2025-12-28 at 01-34-08 InfiniEmu

@github-actions

github-actions Bot commented Jul 26, 2025

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 384956B -276B
data 944B 0B
bss 22640B 0B

Run in InfiniEmu

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty much there I think :)

Comment thread src/displayapp/screens/Music.cpp
Comment thread src/displayapp/screens/Music.cpp Outdated
Comment thread src/displayapp/screens/Music.h Outdated
Comment thread src/displayapp/screens/Music.cpp
@mark9064

Copy link
Copy Markdown
Member

One other thing, could you edit the first message to show screenshots of the latest version? Just makes it a bit easier for anyone looking at the PR for the first time

@tituscmd

Copy link
Copy Markdown
Contributor Author

I made the button labels a bit more gray when the buttons are disabled, so it’s easier to tell at a glance what’s inactive.
I also cleaned up SetConnectedUI and SetDisconnectedUI by using arrays for the buttons and labels, since repeating the same line over and over was getting annoying.

I updated the first message of this PR as well so it matches the current UI, making it clearer for anyone checking it out for the first time - thanks for pointing that out @mark9064 :D

@mark9064

Copy link
Copy Markdown
Member

out.patch

Had a poke around, few suggestions here (mainly to avoid storing copies of all the buttons/labels again). I think the only substantial code change required is to fix the the progress bar narrowing issue, lv_bar_set_range takes int16s and currently the code assumes it can handle int32s

You can apply the changes locally with git apply <path/to/patchfile>

@tituscmd

Copy link
Copy Markdown
Contributor Author

I think the only substantial code change required is to fix the the progress bar narrowing issue, lv_bar_set_range takes int16s and currently the code assumes it can handle int32s

Totally didn't think of that, good catch.
I've clamped both the range and value of the bar to the max value of int16_t. With the latest commit, any overflow issues should be solved 👍

@CodeGuyEli

Copy link
Copy Markdown

This looks super cool!

@tituscmd

Copy link
Copy Markdown
Contributor Author

This looks super cool!

Thank you so much! 😊

@liamcharger

Copy link
Copy Markdown
Contributor

Could we get this added to 1.17? It's a nice qol update

@mark9064 mark9064 added this to the 1.17.0 milestone May 13, 2026
@mark9064

Copy link
Copy Markdown
Member

Added to milestone

@tituscmd can you sync with main (merge/rebase)?

@tituscmd

tituscmd commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@tituscmd can you sync with main (merge/rebase)?

Should be all good to go!

BurninTurtles added a commit to BurninTurtles/InfiniTimeBT that referenced this pull request May 25, 2026
* music app redesign

* removed an empty line

* Some tweaks for the default texts, as well as adding a different approach to switching between skipping and volume buttons

* formatting

* more formatting

* revert back to swiping as a gesture to switch between skip and volume buttons

* remove all unneccessary references to the motor controller

* formatting

* removed accidental change

* correct color of the buttons

* remove redundant initialisers for trackName and albumName

* add progress bar

* Update settings.json

* formatting

* formatting

* more formatting

* different design for music.cpp

* renaming to camelCase, time top center, some visual tweaks

* tweak code for much easier alignment testing

* tweak code for much easier alignment testing

* change controls button

* tweaks to the new swap controls button

* Different version of the music app, where all buttons are on one screen

* another UI iteration, my favorite (volume buttons above track buttons)

* version with buttons up top

* clean up code

* finally got a formatting extension, so this is hopefully the last formatting commit

* finally got a formatting extension, so this is hopefully the last formatting commit (ironically one more)

* some final spacing optimizations

* remove some more (now) unused lines

* lots of code optimization, mainly to get the reconnection smoother

* remove unused emoji

* Update Music.cpp

Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com>

* react to review, most notably change artist, track and album to use DirtyValue

* use bleState.isUpdated() instead of manual lastConnected approach

* change behavior of Refresh cycle

* I'll never understand why it does this

* remove album as member, remove unused members

* remove now unused music disc files

* de-clutter the SetDisconnectedUI and SetConnectedUI functions by using an array for the buttons and labels

* apply patch from github, thanks mark!

* formatting

* clamp track duration to bar range to avoid any possible overflow

---------

Co-authored-by: tituscmd <154823939+tituscmd@users.noreply.github.com>
Co-authored-by: Titus Kendzorra <titus@kendzorra.de>
Co-authored-by: mark9064 <30447455+mark9064@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement to an existing app/feature UI/UX User interface/User experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants