Commit graph

350 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
Christian Soffke
94cf3403e2 shortcuts: add missing voice for sleep shortcuts without name
Change-Id: I1178be8c82671d64746297306b27ee9ccb50c1a2
2025-06-06 19:12:07 +02:00
Christian Soffke
e9d0be5dfd shortcuts: Don't require name for 'time' (i.e. talk or sleep) shortcuts
Change-Id: I5b0777c10527f6a49ac7305ca0ba1d4c269333fe
2025-06-06 18:12:06 +02:00
Christian Soffke
d9feabc720 voice: replace splashf with talk equivalent
Add voice equivalent to splashf messages that require
pauses between individual announcements, or that need
to include their arguments

Change-Id: Ie72326a2371f242de8999761278b22080ba33c81
2025-06-02 21:04:19 -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
Christian Soffke
83a8fc4c7e voice: output_dyn_value: fix scale
regression introduced in 15e5237

Change-Id: Ib107be08d2712b9c74e2795180ac8565c146af0b
2025-05-22 19:41:46 -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
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
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
Christian Soffke
ca459a9d09 misc: Eliminate redundant yes/no dialog functions
Change-Id: I28bc4531cdfe6e28a1677b1a0ebb461e48188fd8
2025-01-15 14:10:17 -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
Christian Soffke
3389a08d56 dynamic playlist erase warning: skip for finished playlists
Change-Id: I9d209a011024e658ffc4da0a723ae8f9ec407702
2024-12-31 14:59:18 +01:00
Solomon Peachy
15e5237469 storage: 64-bit sector offsets
* Create new 'sector_t' type alias:
    * uint64_t for all targets with HAVE_LBA48 or HAVE_SDUC
    * unsigned long for the everything else
 * Alter all storage APIs to use sector_t instead of 'unsigned long'
 * Alter Volume/Partition/storage info structures to use sector_t
 * Disk cache converted to sector_t
 * ATA Core:
    * convert to using sector_t for sector addresses and drive sizes
    * Always fill out upper 16 bits of LBA48 addresses
    * IDENTIFY INFO is fixed at 512 bytes, not SECTOR_SIZE
 * USB mass storage:
    * convert to using sector_t for sector addesses and drive sizes
    * Implement READ_16/WRITE_16 for LBA48 addresses
 * Convert FAT code to use sector_t for all sector references
 * output_dyn_value() now accepts int64_t instead of 'int'
 * Corrected "rockbox info" to work for (MULTIVOLUME & !MULTIDRIVE)
 * Better reporting of disk and (logical+physical) sector sizes in debug info
 * Detect SDUC cards and report on storage debug_info screen

To-do: SDUC

 * Refactor SD core to remove duplicate code in every driver
   * Card probe and init state machine
 * Implement core SDUC support
   * SD2.0 needs to be 2.0+ (fixed for jz47xx and x1000)
   * Host and Card ID (ACMD41)
   * 32-bit addressing for all read/write/erase operations (CMD22)
 * ADD SDUC to target device drivers, defining HAVE_SDUC as appropriate

Change-Id: Ib0138781a0081664d11511037685503df1b93608
2024-08-12 14:23:44 -04:00
William Wilgus
072228bb70 [feature] playlist. show search progressbar when iterating playlist entries
Change-Id: Ib38363f7495ca523e7cc401c0d39e060ed1705ad
2024-07-20 00:08:39 -04:00
William Wilgus
dc7486c7de [Feature] onplay.c show file progress
first some clean-up of onplay.c

extend/move fileobject copy, move, delete routines in prep for other users

add error checking, better error codes
pre scan to make sure the operation doesn't exceed system resources
show progress for file and directory copies

Change-Id: Ife2e62df554892dab651bab40433bf70b27e73ff
2024-06-30 02:09:40 -04:00
William Wilgus
31ae252dcc [BugFix] Resume on headphone plug causes screen glitches
Change-Id: I396a662124a20420f6099522570c14cef4993205
2024-06-02 17:09:24 -04:00
Christian Soffke
3d7d1d4d5b plugins: properties: show track info for whole playlist
Track Info can now be displayed for the set of
all tracks contained in a  playlist. This lets
you calculate a playlist's length, for example,
even if it is not currently playing.

This functionality can be accessed from the
existing "Properties" screen for a selected
playlist file. A line has been added at the
very bottom to show Track Info.

Change-Id: I311532b7cfa9e29d46c0cd5623ba4c06c1dd5b5f
2024-06-01 11:55:36 -04:00
Christian Soffke
fdba79cd77 shortcuts: refactor sleeptimer / talk_timedate
move some functions around, with no effect on behavior

Change-Id: I4638a28f5ff2a851534a3dd696ea7e763029cb2f
2024-05-13 18:18:45 +02:00
Christian Soffke
ea5ce8034b Replace "Reload After Saving" with option to remove queued tracks
The "Reload After Saving" setting was added in
g3347 (4f83e66) to solve FS#13287, by allowing
you to bookmark a modified playlist after saving,
without having to manually reload it first.

Since the rewrite of playlist_save in g5192
(90e3571), a modified playlist doesn't have to be
reloaded anymore in order to be bookmarked after
it's been saved, unless it contains queued tracks.

To cover the remaining use cases of the previously
available option, Rockbox will now offer to remove
any queued tracks from a playlist when saving it.

Change-Id: I2d6f12bcce14d8ff41a4d921ce84d628774103ac
2024-04-21 18:28:16 +02:00
William Wilgus
ed369e1d47 misc.c check_bootfile exit search loop after bootfile found
Change-Id: Ie2397de29e87dfb1d2fb73cb6eb42c94fdfbf356
2023-09-01 23:43:24 -04:00
Christian Soffke
422ea20cef Warn before overwriting another playlist on disk
When saving a playlist to an existing file on disk,
warn user, unless the playlist's file name remains
unchanged.

Change-Id: I10d82667de5fadb5323be4f981bea9263849f07a
2023-06-21 13:09:05 -04:00
William Wilgus
78c92c5ca8 [Feature] Supress voice during sleep timer shutdown
if show_shutdown_message == false and sleep timer is active
talk will be disabled on shutdown

Change-Id: Ia660e753700f3e283691f41797ef7a77a2d9a8d9
2023-04-08 17:13:07 -04:00
Aidan MacDonald
5b27e2255a Add perceptual volume adjustment
The perceived loudness change of a change in volume depends
on the listening volume: at high volumes a 1 dB increment is
noticeable, but at low volumes a larger increment is needed
to get a comparable change in loudness.

Perceptual volume adjustment accounts for this fact, and
divides the hardware volume range into a number of steps.
Each step changes the dB volume by a variable amount, with
most of the steps concentrated at higher volumes. This
makes it possible to sweep over the entire hardware volume
range quickly, without losing the ability to finely adjust
the volume at normal listening levels.

Use "Volume Adjustment Mode" in the system settings menu
to select perceptual volume mode. The number of steps used
is controlled by "Number of Volume Steps". (Number of steps
has no effect in direct adjustment mode.)

It's still possible to set a specific dB volume level from
the sound settings menu when perceptual volume is enabled,
and perceptual volume does not affect the volume displayed
by themes.

Change-Id: I6f91fd3f7c5e2d323a914e47b5653033e92b4b3b
2023-01-22 21:19:57 +00:00
Aidan MacDonald
15c4447b66 Fix red dc83963962
Change-Id: I196268c6f6bc4f6e2d8f2cb7dcc3a12218c5d9d4
2023-01-22 21:19:34 +00:00
Aidan MacDonald
dc83963962 Add helpers for converting to/from normalized (perceptual) volume
These routines were taken from alsamixer and converted to fixed
point for Rockbox.

Change-Id: I64e8bf08da02b1e6e3ef10fdc78254bf8e87ff20
2023-01-22 15:43:00 -05:00
Aidan MacDonald
67cb2e3cdc Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
2023-01-15 08:57:45 -05:00
Christian Soffke
7f265ee8dd Database: Add ability to insert multiple files into playlists
You could only add single files to playlists
from the database browser before. This
enables adding any database selection to
a new or existing playlist.

Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
2023-01-14 12:14:28 -05:00
Aidan MacDonald
1e9ad3ca0d Remove buflib allocation names, part two
Remove allocation names from the buflib API and fix up all callers.

Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2023-01-13 10:32:54 +00:00
William Wilgus
88f6628423 consolidate bmp_read function between icons and skin_parser
uses fd now rather than opening file twice

Change-Id: If35418cbc77adacf5e96fb6aa0fc8ffef2fffcbd
2022-12-20 19:07:46 -05:00
William Wilgus
1930ca8d66 remove rockboxlogo after boot INIT_ATTR
nets about 5k on clipzip  (less on mono, more on others)
to move rockboxlogo to .initdata section

Remove show_logo completely and move to main.c
remove plugin stub
give credits plugin its own copy
credit fallback is now show_info()

Change-Id: Id9ed787e605ed29e7ab1e7a74d3821cd0f840ed4
2022-12-19 18:59:59 -05:00
William Wilgus
6b87bfadff wps.c cleanup gui_show_wps
remove some old cruft move a few things around clean-up flow

Change-Id: I138c6cd9e2d58ef526eb686333da413819df725d
2022-12-14 22:35:33 -05:00
Christian Soffke
8ff2c81bde Improve transition between plugin and WPS
Eliminate flashing when plugins are launched
from WPS, by not enabling the SBS, and by
deferring other lcd updates.

Also prevents flashing root menu activity when
returning from plugins.

Change-Id: I7d761867027f2275c4ab8e16ada3107c7ba0be6e
2022-12-13 21:10:16 -05:00
Christian Soffke
dfd9c10589 Eliminate skin updates in between activities
1) Adds way to pop activity without refreshing the skin at
the same time.

Activities are sometimes popped in immediate succession,
or one activity is popped before another one is pushed right
away. This can lead to the UI appearing glitchy, due to an
activity only appearing for a split-second, which is especially
noticeable with complex skins that change the dimensions
of the UI viewport depending on the current activity

To fix this, prevent superfluous skin updates

* when switching between:
- WPS and browser
- WPS and Playlist Catalogue
- WPS and playlist
- WPS and Settings/System/Plugins

* when accessing Track Info or when displaying
bookmarks using the context menu on the WPS

* when switching from QuickScreen to Shortcuts Menu

2) The playlist viewer activity was pushed & popped
redundantly by playlist_view.

----
NB:
Behavior has remained unchanged in all instances of the
code where pop_current_activity() has been replaced by
pop_current_activity(ACTIVITY_REFRESH_NOW).

Change-Id: I56b517b8c9dba823a9fed3a3f558d7469dcea9fd
2022-12-11 11:50:33 +01:00
Dana Conrad
3555e84a7a Bugfix: some settings can have spaces in them
90bc769 strips spaces from the settings value, but it
goes to the first space rather than just stripping off
the last one. Break out of the loop when we find the
first non-space character.

Also change 0 to '\0' for readability.

Change-Id: I915b82a6d1603740998a67c575d08005456ffbd8
2022-12-08 15:38:12 -05:00
Aidan MacDonald
90bc76956c Ignore trailing whitespace in settings .cfg files
Have settings_parseline() strip trailing whitespace from
the setting value.

Fixes a regression introduced by 5b1dd64f5, which caused
filename settings to be parsed incorrectly when there is
trailing whitespace in the .cfg file.

Change-Id: I6c54428f6467ea2d169d2a7449705b40627e1a40
2022-12-07 08:44:18 -05:00
William Wilgus
fceb4f6292 misc.c format_time_auto() make several const tables static
Change-Id: I597eee8f2d531d4cc2ec69dd8bc78f8cd7950162
2022-12-07 01:40:49 -05:00
William Wilgus
853d70e938 Fix Red confirm_delete, CHECKWPS & DBTOOL
Change-Id: I2f375def92e4c3c4b6be9d0494de682e6d3ebd2d
2022-11-24 23:44:35 -05:00
William Wilgus
71934d4c16 move confirm delete prompt to misc.c
Change-Id: Iadb1c7199caa5070f555eb4d329efb02e3193289
2022-11-24 23:09:26 -05:00
William Wilgus
780990fe5d bookmark.c remove some global buffers
refactor to allow removing some of the static buffers

Change-Id: Ia3ff6ea28f35634fd8c31b023431ad53bd542085
2022-11-24 22:00:14 -05:00
William Wilgus
3745c813f9 misc.c open_pathfmt caller supplied buffer
Amachronic raised concern about open() blocking causing a static buf
to get overwritten in multiple calls its prudent to just have the caller
supply the buffer to minimize stack issues later

Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a
2022-11-23 22:09:46 -05:00
William Wilgus
da2eaf3bf7 misc.c open_pathfmt fix yellow
Change-Id: Id844825726654a3a5b19a1672cb66af9aadaed32
2022-11-20 00:00:40 -05:00
William Wilgus
e7e20fab1b create function open_pathfmt() to allow printf formatting on open()
save some space by allowing printf formatting directly rather than
having a buffer and using sprintf

Change-Id: I049c8f898fb4a68a26ad0f0646250c242647ba12
2022-11-19 23:13:42 -05:00
William Wilgus
972810f6cf strlcpy finish cleanup
remove strlcpy & strlcat from string.h

document suspicious strlcpy call

convert strlcat.h users to string-extra

Change-Id: I313e75db86385c0e6d1aee75d252093be4935f60
2022-11-17 01:54:46 -05:00
William Wilgus
28af87526d misc.c split_string replace with strtok_r
there isn't much difference from this function to strtok_r

now places a NULL in the last vector space permitting as well

Change-Id: Ibaaa1ad01b5054c41a6410788a2333b8d11a7cf7
2022-11-15 23:33:39 -05:00
William Wilgus
f6c719d7ec replace strlcpy with strmemccpy
replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation

in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base

Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
2022-11-14 23:56:16 -05:00
William Wilgus
e8aaee4979 misc.c show_logo remove 'ver.' when screen is too small
since its too early for the scroll engine just remove 'ver. '

cleanup the getstringsize calls, only need to calculate it once

Change-Id: I5e866733ed38ffa0bf34ce1b5e11ed3afd78a04a
2022-11-09 11:22:56 -05:00
Aidan MacDonald
6e4c866756 Remove unused 'may_fade' argument of pause/unpause_action
Change-Id: I4eedcf30fa704521e751732a56775c43e9a8bd99
2022-10-18 12:56:28 +01:00
William Wilgus
79864c6ec2 add const to const * strings
I don't think this will amke any difference except maybe for hosted ports

Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-03 23:00:58 -04:00