Commit graph

585 commits

Author SHA1 Message Date
Christian Soffke
f6cdcc8ca9 voice: LANG_PLUGIN_CANT_OPEN
Change-Id: Icbcbd7ed2dff88065726ce2520fbcc718bc3eba0
2025-07-23 11:13:13 -04:00
Christian Soffke
2bf929c7ae plugins: disktidy: use UI viewport, limit UI updates
- Show stats when finished
- Keep stats on screen until Cancel or Menu
  button is pressed
- Limiting progress updates to 10fps results
  in a big speedup

Change-Id: Iebffaead6e1212306edaa42aad925458d13a5f82
2025-06-05 16:08:58 -04: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
5efb6d7fac Settings menu: add main menu customization
Lets you launch the main_menu_config plugin
from Settings, so that it remains accessible,
even after all other menu items have been
hidden.

Includes minor changes to the main menu config
plugin, so that it better fits in with the rest
of the settings menus:

* Keep theme enabled
* Autosave
* Add "On" or "Off" suffix to each item, to prevent
  confusion when Icon_Config is blank, as is the case
  with certain iconsets
* Update current selection after swapping items
* Prefix spoken selection with row number for enhanced
  clarity when swapping items
* Change title to LANG_MAIN_MENU
* ACTION_STD_OK to toggle an item's visibility
* ACTION_STD_CONTEXT to access options for reordering
  menu items, or for reverting to the default menu
* Ask for confirmation before reverting

Change-Id: I74240b94243224c76e23ef8f3a0559bd8ba28df0
2025-05-23 14:28:29 -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
Solomon Peachy
c7eda36341 misc: Clean up a large pile of -Wexpansion-to-defined warnings
And re-enable the warning (applies with GCC 7+)

Change-Id: I406ce796ebd06bad53cab911e17a28265a79b420
2025-04-21 21:04:05 -04:00
Aidan MacDonald
639b587fc7 arm: add support for processors with hardware division
ARMv7-M has hardware division, so it doesn't require __div0
or any support functions for 32-bit division.

Change-Id: I840683a1a77d737f378899ca4bcf858216b81014
2025-04-18 09:22:48 -04:00
William Wilgus
10f8312db4 FS#13538 export and import battery level tables
when battery_bench is run
exports a file in the rockbox directory called 'battery_levels.default'

if the user wants their own levels they can rename the file battery_levels.cfg
and it will be loaded at boot

some minimal error checking is performed prior to using the values

added manual entry

Change-Id: Ia0126faced0c7229fcf8385a1bcb584b5a9dc378
2025-03-06 11:54:21 -05:00
William Wilgus
277c66d9d2 : [bugfix,bugfix] ensure PREVIOUS tree_context dirfilter is restored on plugin exit
Change-Id: I521e8d660ca76744f5452643578c2f7e5651b870
2025-01-23 19:50:48 -05:00
William Wilgus
9bcf6a8bb7 [bugfix] ensure tree_context dirfilter is restored on plugin exit
rockpaint is the only plugin doing anything dit setting the dirfilter pointer
it appears to restore it but this is cheap insurance on weird crashes
that result..

Change-Id: I70c826d6ec4c9cb6e1539ab23f1de82ca3e67ad1
2025-01-22 00:33:54 -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
William Wilgus
c3fd32bdf2 [Feature] playback logging from core
people don't like having to remember to run the TSR plugin so
lets meet them halfway

all tracks are added with timestamp, elapsed, length, trackname

added buffering for ATA devices

still needed:
-Done -- a plugin that parses for duplicates and reads the track info
to create the actual scrobbler log
(log can be truncated once dumped)
this should allow you to run the plugin at leisure

later I'd like to expand this logging to allow
track culling based on skipped songs..

remove the TSR plugin as hard disk no longer need to use it

Change-Id: Ib0b74b4c868fecb3e4941a8f4b9de7bd8728fe3e
2025-01-13 00:45:09 -05:00
Christian Soffke
05a77178ff plugins: fix plugin handle reset after plugin load failed
e519356 prevents loading further plugins otherwise

Change-Id: I97dc14aa5d0e0471d264f006593f62da3fd4394a
2024-12-08 12:22:00 -05:00
William Wilgus
da9d67a0fe Button queue handling is split from main button driver
First half of
https://gerrit.rockbox.org/r/c/rockbox/+/570

Change-Id: Icc64dfd8194c18f69564ed5f8bf7dd70a4330eb9
2024-11-27 20:16:53 -05:00
Roman Artiukhin
e519356c47 plugin: don't start plugin when another non-tsr plugin is running
Change-Id: Ie5fc8220e5d586a5493992719c55e9d2f235b090
2024-11-09 04:26:15 -05:00
Solomon Peachy
b30f05badc Revert "plugin load / tagtree retrieval: eliminate storage_disk_is_active check"
ata_disk_is_active() behavior with SSDs has reverted, so we want to keep this.

This reverts commit ef19fa4408.

Change-Id: I29f08617285747c17a52352bd7bba4069e71cde6
2024-10-31 12:52:00 -04:00
Christian Soffke
ef19fa4408 plugin load / tagtree retrieval: eliminate storage_disk_is_active check
Since commit e0df995 storage_disk_is_active may be 0
even if there is no disk that needs to be spun up or
device to power on, so it doesn't really make sense
to check for it, anymore, in order to decide whether
to display the loading indicator.

For remaining devices with spinning disks, the noise
or vibration of the disk spinning up may serve as a
sufficient signal when loading a plugin, that the
device isn't frozen. Plus, for the tagtree, search
progress is displayed after 0.5s anyway.

Change-Id: I5791725e2388d7113818a358204968d8a4e6f843
2024-10-14 09:27:26 -04:00
Christian Soffke
2f8cab9190 plugins: properties: keep theme enabled
Launching a themed plugin can cause the screen to
flash due to the theme being disabled, before it
is re-enabled right away. For the Properties plugin
in particular, this seems a bit annoying and
unnecessary.

Change-Id: Ifa0275b453369051cc63a3c626551f54120fdb41
2024-07-30 22:08:18 +02:00
Solomon Peachy
86bff6214d properties: Use talk_fullpath() for voicing directory names
Change-Id: Ib40c881e7b3053e7e4ef5c5adbe5c3bfec27efed
2024-07-28 17:01:53 -04:00
Christian Soffke
23e5f77ab0 Remove mp3info function & remove list_do_action from plugin_api
Change-Id: Ia9a2d6889679832f23b19a989927277ba886cba4
2024-07-26 15:15:06 -04:00
William Wilgus
7e90760a48 [Feature] Playlis to cue plugin
generate valid cue files from a playlist

uses remarks to store extra id3 info and display and playlist index

Change-Id: I00c9f6389445bb601dde6eb8f36157044024f8cb
2024-07-20 07:27:01 -04:00
Solomon Peachy
eb2146d683 plugins: add lang_is_rtl() to the plugin API.
So plugins can put stuff in the correct order, if they care.

Change-Id: Iac322bcb8cf78b37d3caef4c8d7b2a14923669f4
2024-06-18 12:50:52 -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
William Wilgus
ee840709d3 [Feature] Open plugins now recognizes known filetypes and can run them
now you can run your lua files without having to add the viewer to
the shortcut or if you want a bmp file to be displayed when you start
the device that can be done as well

Change-Id: Ia56b566789623a2ca78d9e4583086db6e2cd689b
2024-05-06 17:27:25 -04:00
Christian Soffke
ba62798746 Playing Time plugin: Fix calculation for shuffled playlists
Playing Time produced incorrect results when
the playlist's first index wasn't 0.

Change-Id: I1c11b876e0e435c824c9ddc0863fd7ee76bda073
2023-10-31 17:58:17 +01:00
William Wilgus
2e184d129d [FixRed] db_commit
Non Tagcache targets

Change-Id: I0e6c1e8551859863105f97f393b308bca947c6d4
2023-10-05 22:59:05 -04:00
William Wilgus
1ed640da24 [Feature] db_commit plugin allows a more verbose commit
prints logf messages to the screen buffer and dumps the
output to .rockbox/db_commit_log.txt

logs warnings about tags that can't
be displayed by the current font

adds an option to the tagcache using the file
.rockbox/database_commit.ignore to prevent auto commit

Change-Id: Ib381b3b6d9dd19d76c95d0e87e605f7378e29674
2023-10-05 21:24:37 -04:00
William Wilgus
6634a60bf0 tagcache/tagtree remove static buffer from tagcache_get_next
callers can supply their own buffer

Change-Id: I8996ecfb88e30926296a0cb0563cf6c46977323e
2023-10-03 21:54:19 -04:00
Christian Soffke
cb3a6877fc RFC: Turn Playing Time function into plugin
Since this function already requires hitting the
disk, it may make sense to turn it into a plugin.

A minor advantage (apart from cleaning up onplay.c
and saving RAM) is that you can now access the menu
not just from the WPS context menu, but also from
the Shortcuts Menu or using the WPS plugin shortcut.

On the other hand,  TSR plugins would have to be
terminated when Playing Time is launched, as is
already the case for other plugins such as PictureFlow.

Change-Id: Iea85229486887463ffc52f05e33e2340437f69a4
2023-09-20 23:57:39 -04:00
Aidan MacDonald
9ba51e3552 playlist: Remove playlist_add()
It was only used in filetree.c. It's still implemented in Lua so
scripts using rb.playlist_add() won't break, but has been removed
from the Lua API "backend".

Change-Id: I5625a47f0692456008c6b10dee14755151d22f29
2023-07-02 12:14:33 -04:00
William Wilgus
a2e5d9563f [Feature] resume TSR plugins after interruption WIP
save tsr plugin path for later

resume tsr plugin when user stops the interrupting plugin

expand return of tsr_exit function to allow
continue, suspend, terminate

tsr plugins check parameter at start to determine if
the plugin is being resumed

Change-Id: I6fc70de664c7771e7dbc9a1af7a831e7b50b1d15
2023-03-25 10:02:43 -04:00
Aidan MacDonald
a64cad847e playlist: Simplify playlist modified detection
Any modifications to the playlist (insert, delete, shuffle, etc)
will cause the modified flag to be set. The flag is cleared when
the playlist is saved. Code that generates playlists can manually
clear the modified flag if appropriate; there is now a proper API
for this so the tagcache and pictureflow don't need to resort to
hacks.

Change-Id: I8d3c723265a41db07a13de3f1d2abb0444528d57
2023-03-23 13:01:23 -04:00
Aidan MacDonald
d40a598970 plugins: Simplify plugin/codec API versioning
Replace the minimum version bound with a check on the size of
the API struct. The version only needs to be incremented for
ABI breaking changes. Additions to the API won't need to touch
the version number, resulting in fewer merge conflicts.

Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f
2023-03-21 16:23:54 -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
Christian Soffke
32f365bf3c database: make parent tables work with plugin
Enables the use of PictureFlow and the Properties plugin
with parent tables of ALLSUBENTRIES, such as an album
or album artist, instead of individual tracks.

Change-Id: I18c4779ed116a48c732ae32b9629e7e0d93ce7c8
2023-01-19 15:56:35 -05:00
Christian Soffke
e61a5c957c PictureFlow: Add ability to insert into playlists
Songs or albums can now be added to new or
existing playlists directly from PictureFlow.

Change-Id: I6ea27e393fee0d5688385f9e91cf835be1756a7a
2023-01-14 19:44:11 +01:00
Christian Soffke
1e4ee1917c Fix red in 7f265ee
Change-Id: Ib2496af0ed6176ea537e1f61804c1ba514374fb6
2023-01-14 19:40:29 +01: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
Christian Soffke
a513cee822 PictureFlow: Add 'Track Info' for tracks or whole albums
Context menu gains new option to view
metadata for individual tracks or albums.

Will display an album's length and total file size.
Other fields are displayed only if they are identical
across all tracks (except for the album year, which
is determined by the highest value encountered).

Change-Id: Ibc14cfaf2cb3d91b8d1cfbee05c6261db4975355
2023-01-10 18:50:12 +01: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
Aidan MacDonald
6c52fa139c Remove browse_context_init()
Prefer to use designated initializers to avoid having to specify
unneeded parameters. Non-initialized members are zero-initialized
by the compiler.

Change-Id: Ia6a03c45cb3ef0b30f458d7d0ae1604a350c737c
2022-12-17 13:36:38 +00:00
Aidan MacDonald
701e262d3d settings: Remove setting ID return from find_setting()
Now that all users have replaced setting IDs with direct pointers,
find_setting() and friends don't need to return an ID value.

Change-Id: I8c5c31bb68d3bca5350d43538335265a55fd5517
2022-12-17 13:36:38 +00:00
Christian Soffke
222ff0cb14 Plugin return: only skip SBS refresh if WPS was previous activity
1) the plugin return value isn't necessarily respected.
2) the screen will be updated regardless, before
the WPS is displayed, which means the skin may
appear in an "incorrect" state for a moment.

It is therefore better to simplify this to a single
condition.

Change-Id: I723e6fe4862172075b9a4814080f612c2b2fb490
2022-12-16 13:04:56 +01:00
Christian Soffke
79e6139f56 Playlist Viewer: Fix delayed appearance of backdrop on return from plugin
Change-Id: I84ff9b581d185fecbe3c7405d3e1887715d55d17
2022-12-16 02:05:33 -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
0e2e9df991 Plugins: Eliminate 'Loading' splash unless disk is inactive
My impression is that the waiting time for plugins
is only ever significant if a disk needs to spin up.

In other cases, the experience seems nicer
without a 'Loading' splash, especially for
often-used plugins, such as 'Properties',
when it is launched from the Database or
from the File Browser.

Change-Id: I018ccb13466fa618ef089b6dc7714db38cffd9b6
2022-12-13 20:52:09 -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
Christian Soffke
498988d34a PictureFlow: Minor fixes & changed defaults
- Fix FPS counter overlapping
the artist string when
"Show album title" was set to
"Show album and artist at the top"

- Fix disappearance of center album
if certain Settings menus had been
accessed while list of tracks was
showing and you then returned to the
list of albums

- Fix disappearing album artwork after
cache had been created until you started
scrolling

- Enable context menu even if WPS
integration is disabled

- Make splash screen appear only
on first launch and for database
updates, when it is actually on screen
for long enough

- Eliminate 'Loading' splash if tagcache
is in RAM

- Show both album and artist by default on
displays whose height > 100px

Change-Id: Ie70c0d9093789294d288a4f88338ee4a588bf4a5
2022-10-22 09:33:50 +02:00
William Wilgus
12ef045fdf move buflib_free invalid handle check to the function
allow buflib_free to check for invalid or already freed handles
within the function -- remove all the invalid handle guards thru core_free

Change-Id: Ibdcbc82760fc93b674c42283fca420d94907df8e
2022-10-15 09:26:58 -04:00