Commit graph

2011 commits

Author SHA1 Message Date
Aidan MacDonald
e24deccd00 sound: fix volume change being reported to %mv tag on boot
Setting the last_volume_change time was moved here in
commit 2e08b0f82e ("sound: update global volume state
in sound_set_volume()"); however this also triggers the
%mv tag on boot, as if the user was actively changing
the volume.

Move the last_volume_change update back to the original
call sites to fix this.

Change-Id: I895112cea4315f194f67c27839f1082d67c1ffa9
2025-10-03 10:01:02 +01:00
Aidan MacDonald
b19b95c00f sound: update global volume state in sound_set_volume()
Instead of calling sound_set_volume() and then manually
setting global_status.volume to match, update the global
volume state directly in sound_set_volume(). This makes
things a bit simpler and less error-prone.

Change-Id: I4db4d60ae1a72bd051ef49c90b1ae7f5ba59e535
2025-10-02 14:32:54 -04:00
Solomon Peachy
d7d7627baf checkwps: Validate %?St() tags
This will bail if referenced setting name does not exist.

Change-Id: I7abd54ec1260d3da6024ebec809f8e270b0a84e5
2025-09-27 10:19:20 -04:00
William Wilgus
31c8c0496b Bugfix Zero runtime not reset runtime while charger connected
I can't repro the users issue guessing its the difference with
charging monitor vs not

https://forums.rockbox.org/index.php/topic,55406.0.html

Change-Id: I252f48cd24a9cb0fb2b899352fe9f9ac540a9a5b
2025-07-19 09:19:38 -04:00
Christian Soffke
5f593fb000 album art setting: use settings callback
Since even Shuffle and Repeat are now immediately applied
from the Quickscreen, I suppose it makes sense to do the
same for the album art setting as the remaining holdout.

Change-Id: Ib1b56c31f28d8197e001901296d9897a23134564
2025-06-15 11:30:59 -04:00
Christian Soffke
fbbf08575f quickscreen: remove callback
this isn't used by anything anymore

Change-Id: Ia94b34a5e72b3b78e5e65f0a7a75c4aa347f0100
2025-06-15 11:30:59 -04:00
Christian Soffke
5f05d66853 quickscreen: fix disappearing elements in misbehaved themes
Adjusting certain settings from the Quickscreen causes a
GUI_EVENT_NEED_UI_UPDATE event to be sent. For example:
Changing the Repeat or Shuffle setting while music is playing
or paused (which results in audio being flushed and tracks
being reloaded immediately since commit 1c80f53)

This creates an issue with themes such as Terminal(Two),
FreshOS, or Themify, which appear to have viewports that
overlap with the UI viewport, thereby wiping out the
Quickscreen viewports.

We now redraw the Quickscreen when a full SBS update is
requested, similar to how it is done by lists. You'll still
see the viewport flash in case of misbehaved themes, so,
ideally, these themes would receive an update by their authors,
removing any viewports that overlap the UI viewport.

Change-Id: I7affbb70fc2e72fd6e1418196559204aec125e12
2025-06-15 11:30:59 -04:00
Christian Soffke
c51ca1eeb5 voice: splash_progress
Says "Loading x%" in previously unvoiced splash_progress

Change-Id: I81780e3baf6ea8a8871a4433e1a733100b8cd5f6
2025-06-02 00:03:42 +02:00
Christian Soffke
f3d127f372 Minor confirm prompt adjustments
* Rename LANG_RESET_ASK to LANG_ARE_YOU_SURE,
  so that it matches the actual language string
  (translations remain valid), and can be repurposed
  for generic confirmation prompts, where the
  first line says "Are you sure?", and the second
  line reiterates the selected action

* Add "Reset Settings" as second line to the prompt
  shown before resetting settings, instead of just
  asking "Are you sure?"

* Make Shuffle prompt consistent between WPS and
  Playlist Viewer, and ask whether user is sure they
  want to Shuffle instead of warning them that the
  current playlist will be erased, which was a bit
  misleading

* Explicitly say "Cancelled" when user answers NO to
  erasing the current playlist or to overwriting a file.
  Improves consistency with other prompts that are
  displayed for potentially destructive actions, e.g.
  before items are deleted, renamed, saved, or reset.

* PictureFlow: Prompt before rebuilding/updating cache

Change-Id: Id8ae36db7187315eb1a374701307e6ab4dcdbd1d
2025-05-26 23:15:53 -04:00
Solomon Peachy
39f86858c4 voice: Convert a pile of splashf() messages to be voiced
Basically, this just replaces str(STRID) with ID2P(STRID).

The voiced version of these strings cannot not have any format
specifiers (enforced by the language tooling) and are instead more
generic.

As many of these are error conditions, it is doubly important for
them to be voiced in some way.

There are some places in the code that perform their own voicing
for splash messages (eg the shutdown code); those are left alone.

Change-Id: I7d51af351e8fa5c4beee42fbfc02719f1d6591b8
2025-05-17 17:33:46 -04:00
Solomon Peachy
622ff574e7 splash: splashf() should be voiced if given an IDPTR
Most calls to splashf() use str(IDNUM), those can be safely
moved to ID2P(IDNUM) now.  Those will follow.

This change effectively makes splash() a simple wrapper around
splashf() so just make it into a #define instead..

Change-Id: I820e74e34cb4be3f523b25ce3f5dcc341bdba3e4
2025-05-17 16:13:58 -04:00
Christian Soffke
2b30a9fed8 sb_create_from_settings: Fix crash when ui viewport setting malformed
The 'Purple_Glow_V3' theme uses the following
'UI viewport' setting which is missing a comma
after the viewport height:

ui viewport: 0,0,271,212-,-,-

The setting is actually ignored when loading this theme,
since a UI viewport is already defined in the supplied
SBS file.

Rockbox will crash, though, when and if the next theme
that is loaded resets the SBS by setting it to "-", but
doesn't adjust the UI viewport setting at the same time.

To fix, use default UI viewport when encountering fewer
parameters than expected for the UI viewport setting.

Change-Id: I2648565ac59369ce8ab18d8e84b7fa69ad767f25
2025-03-25 00:02:43 -04:00
Christian Soffke
095729eb7d Revert "Eliminate SBS update on WPS exit"
This reverts commit 18c8e554fd.

Unfortunately, this approach doesn't play super-well
with *all* themes, specifically in cases where the user-
set background color, used for drawing on the backdrop,
doesn't really blend in with the skin's actual background
color. Plus, it may leave some patches of color behind,
if a theme author didn't take care to cover all parts of
the screen with foreground viewports.

Change-Id: I0159b2e5de6c0753dea54bc6bafe5bc6268a0c6a
2025-03-23 05:15:44 +01:00
Christian Soffke
bc035803ba WPS/FMS: Request SBS update after softlock
Elements from the SBS would disappear after
softlock, for a WPS that displayed an SBS,
if lock notifications were enabled.

If SBS isn't used, the request doesn't
result in any immediate action.

Change-Id: I7f5e8874f4eade6f504b6b3748c9644529587bb2
2025-03-22 21:46:27 +01:00
Christian Soffke
18c8e554fd Eliminate SBS update on WPS exit
Prevents flashing an outdated backdrop when moving
from WPS to SBS, if both were using the extra
frame buffer (i.e. both used background viewports),
without having to update the SBS first. I think,
this is actually what we want, rather than commit
c1222d65e2, which attempted the same thing.

Change-Id: Iffc7fe2d351ebdf21a4e7629aba93641c0d30b50
2025-03-22 17:23:08 +01:00
Christian Soffke
c1222d65e2 Update SBS on WPS exit only when both use extra framebuffer
Change-Id: I853add515231f319cc76f16f322ceb23bc920d72
2025-03-20 18:10:50 -04:00
Christian Soffke
86beaab964 wps: update SBS before leaving WPS
The backdrop layer for the WPS was redrawn
before returning to the SBS, resulting in
unsightly visual effects such as album art
(drawn on the backdrop) losing a frame that
was drawn in the foreground.

Change-Id: If5bb1ba83d79d6d1f637e06f9cc5eab3b97d5906
2025-03-19 22:41:50 +01:00
William Wilgus
dccda8c76f [Bugfix] FS#12436 cache mode strings prior to font disable
by checking string len we can cache the USB hid mode strings

I guess if the user doesn't have enough glyphs they might still
might not get the whole thing but this appears to work with
50 glyphs and the referenced russian language selected

remove call to  GUI_EVENT_ACTIONUPDATE it is now counterproductive

Change-Id: Ica96ed39c7d002fde2d1888e78d2ea18e7c1d61a
2025-03-11 11:41:17 -04:00
Solomon Peachy
8ef4f217d4 checkwps: Warn if using SYSFONT in a viewport
Change-Id: Ief69dd489d08af62ed96624dfe504ab5b9f9e6d9
2025-03-07 09:39:53 -05:00
William Wilgus
ef03dde011 skin_parser small clean up add percent_parse_param()
consolidate the logic for PERCENT tags to a single function

is_default() check is redundant in parse_albumart_load()
static bool isdefault(struct skin_tag_parameter *param)
{
    return param->type == DEFAULT;
}

Change-Id: I7391224499624db7a95a2630f96e33827d1e7542
2025-03-03 11:44:26 -05:00
William Wilgus
81c65536ec [Bugfix] #FS13567 5+ fonts WPS file causes next theme loaded to fail
Investigating this issue I found that when
SBS and WPS share the same fonts the refcount prevents
the soon to be unused font from unloading
by the time the fnt is unloaded its already too late because the WPS
load failed.

What appears to work is freeing the fonts used by the skin items ahead
of time via skin_reset_buffers() in a separate loop instead of in the
loop used to load the skin files

Change-Id: Ib118163185d48b67b7c96e436bfb6fab8db546a9
2025-03-02 14:41:06 -05:00
William Wilgus
cebbbb9ea4 make splash_progress lock to screen width on repeated calls
when calling splash, splash_progress repeatedly text rearranges and
the width changes leaving artifacts on the screen from the previously
displayed prompt

save the max width seen between calls to ensure the splash
prompt is never more narrow.

Height could be stored in a
similar manner but I deemed it unnecessary as typically the
text gets longer and the prompt increases in height
while the reflow causes the prompt to get more narrow.

keep track of the current activity and reset the max_width
when activities change (except bootloader)

Change-Id: I3303bd9135ab1d7bcf28bd5c28d0ab5346bf2697
2025-02-28 12:09:55 -05:00
William Wilgus
19956a0777 [Bugfix] WPS pause while WPS not active causes display corruption
Discovered this in the sim with car adapter mode: on

when charger gets disconnected the device is paused

if you have a different screen up the scrolling elems
get redrawn incorrectly over the current screen

to fix check the activity is the WPS, FM, or RECORDING  before allowing redraw

Change-Id: Ie3618347fde446fe0b78b9d3c67261ca63ffee1c
2025-02-24 12:16:44 -05:00
William Wilgus
50da856992 [BugFix] itoa conflicts with mingw rename to itoa_buf
Change-Id: Ife361f2fd8c8946db5bb2e0e58c0981b2ed3c5f3
2025-02-18 10:41:18 -05:00
William Wilgus
e09b466554 screen_access add set_drawinfo
Change-Id: I32e4932eb3a6f06d45aff2cd767484d254a1c9ff
2025-02-08 00:49:28 -05:00
William Wilgus
f55fe21f66 add itoa(), replace snprintf("%d") calls
we can save some space and still end up with a 20% faster function

Change-Id: Ia58900122944b8527ef01a673afe18ea794acb41
2025-02-03 01:23:49 -05:00
William Wilgus
db477bdeda settings.c make lasttime static
statusbar can use reset_runtime() and we can ensure topruntime gets updated
before clear

Change-Id: I3712649fc394c42f911ec88404c831422872c25b
2025-01-21 18:48:05 -05:00
Christian Soffke
2debcf2c1f Fix %Vp in SBS error message after USB disconnect
Stops “Error accessing playlist control file” message
after returning from USB mode, due to control file
fd being closed

Change-Id: Ic4ecb276ef32f8dc24fe7e540742161b50934c73
2025-01-21 22:24:20 +01:00
William Wilgus
7100090f99 Remove NVRAM infavor of a separate cfg file
remove nvram and use the existing settings framework for it

add a crc check to the user_settings data to see if we need to save
the user setting file or if we can just save the status file (resume.cfg)

move volume to the system_status struct so we don't write the whole settings file
over volume changes

allow user to still export volume with save sound settings

allow the user to also export pitch and speed

name the file .resume.cfg

Rename all the SYSTEM_STATUS save file variables to TLAs to save space and
discourage tinkering

Cleanup DEBUG_AVAIL_SETTINGS output

when saving user_settings it calls status_save as well this cause the resume
file to be written twice. instead remove the callback for status_save
when setting_save is called

remove header text when saving .resume.cfg

convert status_save() to status_save(bool force)
add SYSTEM_STATUS_UPDATE_TICKS

for ATA device set this to 5 minutes
since we arlready wait for the disk to be up before saving
we don't want to miss our window

for all other every 15 minutes

that way if the battery is too low by the time shutdown comes around you
don't lose much progress

Change-Id: I27214ffd6e5d5494ee5ca83b14f04a41ba426ad7
2025-01-21 00:04:32 -05:00
William Wilgus
4e271642df [Feature] Persist pitch settings through reboots part deux
Revisit this after discussion with chris_s on IRC and forum

Pitch menu now changes icon when pitch has been changed

uses NVRAM to save the pitch settings unconditionally

Manual updated

Change-Id: Idcb4c2b7fe42f7a203dc4bfc46285657f370d0fd
2025-01-19 00:29:47 -05:00
Christian Soffke
3e57ca15a5 skin_parser: fix parse_filetext fd not closed
Change-Id: I5efb0474a349c2cdf58e8e6dfd3de6fb40444a79
2025-01-18 14:32:01 -05:00
William Wilgus
13c3214d9c [Feature] Persist pitch settings through reboots
saves the pitch setting across reboots

adds option 'Reset Setting'

Change-Id: I75d88f9653883a256c6cca0f7adcdccb2dd51406
2025-01-17 22:42:15 -05:00
William Wilgus
54333536fe [BugFix] YesNo screen wait for button release on exit
if you run yesno screens back to back or another screen with
wait_for_release you may never see the release

instead clear anything in the queue but release events

Change-Id: I1b1e42cbb44f2fdfed441ab1f217b6ea4fe07492
2025-01-17 00:42:25 -05:00
William Wilgus
e5690803c6 Small cleanup statusbar
move some things around and split out a few things to their own functions

Change-Id: I76ce216776ca939f030cb0b2caefc09b56fe66df
2025-01-17 00:08:28 -05:00
William Wilgus
0b5f1b68e6 [Bugfix] Copy current lcd contents into empty background buffers
the manual states the following:
%V(0,0,-,-,-) %VB
Use %x(filename, 0, 0) to draw a backdrop image (If you want one!)
Then add %V(0,0,-,-,-)

if you forget then it causes display corruption
due to the uninitialized background buffer

instead make a copy of the current screen into the blank backdrop
so we won't be showing garbled data on the screen

Change-Id: I3f0df131d36537e91688e104c9445a604f657362
2025-01-06 02:26:11 -05:00
Christian Soffke
384c35418a FS#13537: format_sound_value alignment issue in themes
Positive values included a leading space, which
meant they weren't displayed center-aligned in
themes anymore.

Change-Id: Ibe75e9b81a2989c87630dd3ea78e4b90c6c74502
2025-01-03 13:45:14 -05:00
William Wilgus
888f4dbe57 [Fix Yellow] skin_backdrops.c screen is unsigned
Change-Id: Ib9a669f547c86d610b22ca85e761920dd5875243
2025-01-02 11:38:46 -05:00
William Wilgus
e65543cdc2 skin_backdrops cleanup
no functional changes.

remove some checks for screen when SCREEN_REMOTE
is not present

pack the skin_backdrop struct and use the space to remove
the static bool first_go variable

Change-Id: I17a96749d4995dd8124f3be4dd95bba58ee54b6d
2025-01-02 11:22:32 -05:00
William Wilgus
44e36aba94 skin_render small cleanup
should be no functional changes
looking at the blame for this file shows the buffer was made
static originally due to stack overflow.

Removing static buffer in favor of using the skin buffer
directly shouldn't cause a regression.

Change-Id: I941ed675c5ba8799bea678af61c196eb453a4788
2024-12-31 20:17:56 -05:00
William Wilgus
727d2ab749 wps skin_parser free up skin ram with int16_t
change ints to int16_t especially image and rect sizes

ditto font_ids

frees ~250 bytes in cabbie

Change-Id: I271be05a26e2090f6e1b11d809afd1c4bee32803
2024-12-31 01:53:20 -05:00
William Wilgus
0c4b78c011 [Bugfix] RTC_TOKEN_PRESENT is less than SKIN_TOKENS_RTC_BEGIN
this blocks the check for RTC_TOKEN_PRESENT

thanks, chris_s

Change-Id: I53a7d83d7cd8e5e9b9d6ea6eed016dc35571bcd3
2024-12-26 08:56:14 -05:00
William Wilgus
b07d7d6af0 skin_token.c, playback.c, add get_temp_mp3entry()
add function get_temp_mp3entry() to return a valid mp3entry from scratch_mem
UNBUFFERED_ID3
or if playback hasn't been started used statically allocated mp3entry
NEXTTRACK_ID3

Change-Id: I3909fb585e0f5ad590f917ce827e991440f1fe75
2024-12-26 00:58:51 -05:00
William Wilgus
b44f8f3723 [FixYellow] skin_tokens.c add a preprocessor directive that actually works
Change-Id: I4345093be1d953e80f0043f6edd361517f74069b
2024-12-25 01:40:53 -05:00
William Wilgus
4fe6ce91ec skin_tokens.c use static mp3entry if over 2k
Change-Id: I5c1130673d2caf1198aa65c2b84bc7102f768c3d
2024-12-25 01:27:52 -05:00
William Wilgus
6bec4597bf get_mp3entry_from_offset remove static from struct mp3entry
I think with the recent refactoring we should be able to put mp3entry
on the stack

it should be moved up a level anyway

Change-Id: Idd2af598c48545e3dbc774279b5d2b264012805e
2024-12-25 00:56:49 -05:00
William Wilgus
8981311800 skin_tokens.c break quickscreen items out to a function
rather than a function call for each qs item along with the data
for those calls in the switch for get_token_value()

it makes more sense to just have the qs_token function
handle all of the logic

Change-Id: I3b3072496611fc2c536eec33c7cdf9fb2ec67ee0
2024-12-24 12:43:26 -05:00
William Wilgus
f6b13c0fd0 skin_tokens.c break rtc code and id3 into own functions
clean-up the switch a bit by putting rtc code in its own function

move the id3 tags to the default branch and only read id3
if its actually needed

Change-Id: I0a6fe9aea646defcfdda731c4c963977173c4133
2024-12-23 22:57:52 -05:00
William Wilgus
dfd01709c5 [Bugfix] theme %ss will overflow buffer, update %ft manual entry
%ss did not check for the size of the resulting string before
copying it to the buffer

%ft has a search text mode

Change-Id: I1321681c249251aafe0e39bcc510b9e81f0cd0d3
2024-12-22 23:59:31 -05:00
William Wilgus
7d1cdf3ece small cleanup skin_parser parse_album_art parse_image_load
bugfix parse_font_load() allow fonts with . in filename

Change-Id: Idcd201f624699e184e5181a46848c36b7e3fca49
2024-12-22 09:18:22 -05:00
William Wilgus
7c678f5e7a [Feature] %ft file text tags add prefix search
%ft(filename,search_text)
finds a line beginning with search_text strips search_text and returns
the remainder of the line

Change-Id: I06fe029b89aa60e4dbf34c039d180c75213519a4
2024-12-22 01:11:10 -05:00