Screensaver while playing option / blank screen instead of clock options #129
+104
−11
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.
Another pull request!
This adds an option to display the screensaver while music is playing. Timeout is measured in minutes -- to a maximum of 1080 minutes = 18 hours = 64800 seconds just to keep it as a
uint_16
like the other. This time I followed your lead on adding this option to the WebUI.By the way, I love how dense and modular this code is! It makes editing it a bit hard at first but clean and efficient!
I added a bit of enforcement to the screensaver timeout so the lowest setting possible for
screensaver
is5
(seconds) and forscreensaverPlaying
is1
(measured in minutes) (added enforcement to both html and cpp).I also "fixed" the screensaver which was getting cut off if located too low on the display... but I'm not entirely certainly using
dsp.plItemHeight
was correct. I couldn't seem to find the pixel height of the clock font but on my small OLED, it looks like the playlist and clock use a similar enough font size.In
display.cpp: 537
:Didn't want to edit the readme because I'm not sure what version number you'd like. Unfortunately, it means yet another
full update
.Relevant bits in
script.js
(4 lines added):Edit/Addition:
Also added an option to completely blank the display for either screensaver option. I personally like the clock on when not playing but I use it at night when sleeping and my OLED is too bright so I can now just have it turn off after a minute.
BTW, next up I will try tackling the problem of time zones. I have a bit of experience with this one on other projects (I like clocks!), so it shouldn't add to much to the codebase (although may require another file in
data
. We should be able to use named TZs instead of UTC offfset... this is a bit of a selfish one because although I live in Korea right now, I'll be going back to Canada soon and Daylight Savings times is silly but a fact of life for most North Americans (and some Europeans).