1
0
Fork 0
forked from len0rd/rockbox
Commit graph

700 commits

Author SHA1 Message Date
Christian Soffke
2ddcc95423 tagtree: Fix FS#13651 database track titles not voiced with extensions turned off
regression introduced in commit 26c612f

Change-Id: Id2328a9f0de1fefdfddc7572524cb22a0668af96
2025-08-05 15:54:11 +02:00
Solomon Peachy
4ab056ab15 database: Respect global "talk menu" setting in the database tree
Should fix FS#13625

Change-Id: Ibc6210be45941b2074da1e5c11536bcd31b5ac8f
2025-05-17 08:27:33 -04:00
Christian Soffke
93b1611474 tagtree: defer context menu disk access
When the database isn't loaded into RAM,
or the "quick" load setting is enabled,
filenames for tracks must be retrieved
from disk.

With a single track selected, this
can cause a delay before its context
menu is displayed.

Since filenames are only needed after the
user has selected something from the menu,
it makes sense to defer retrieval until
disk access becomes inevitable.

Change-Id: I72b57eff3102b50f3e19441119e20aad903b1f2b
2025-04-17 08:23:45 -04:00
Christian Soffke
df7d68a6e2 Have "Create Playlist" always create playlist from all tracks
Change-Id: Ic04724139d03417f7cac55f3cfa5aed5610c9747
2025-03-13 19:28:04 +01:00
Christian Soffke
87344d180b Rename 'Playlist Catalogue' to 'Playlists'
When the Playlist Catalogue first appeared in the main menu
in 2011 (FS#11808), the 'Playlists' menu item was renamed
to 'Playlist Catalogue' which seems more verbose than is
necessary these days.

Since we don't have a 'Playlist Catalogue' menu item in the
onplay menu anymore, either, LANG_CATALOG can be eliminated.

Change-Id: I7f38b0847e9b982506371f4a4b473d1fb2551ad0
2025-03-09 17:46:52 +01:00
Christian Soffke
7693ecc2a2 tagtree: Improve suggested playlist filename for "special entries"
Make the suggested playlist filename for special
entries such as "[Random]" or "[All Tracks]" a
bit more descriptive, by mentioning the current
table as well, e.g.:

"The Beatles [All Tracks].m3u8", instead of just
"[All Tracks].m3u8"

Change-Id: I43d9386c06081540cdcae715afc0b0351857633d
2025-03-09 09:05:52 -04:00
William Wilgus
d5db4202ab [Bugfix] tree.c tree_get_file_position() case insensitive search
some targets have case sensitive filesystems

Change-Id: I50744b8226318c3dea3db375e545dbd52998544f
2025-03-03 13:15:34 -05:00
William Wilgus
fb96ae2cc9 tree.c small cleanup no functional changes
Change-Id: Icb165ed94f8e1a165f285c7482c46d6e74846d10
2025-03-03 12:58:09 -05:00
William Wilgus
5471f58fb1 [Bugfix] set_current_file_ex filebrowser wrong file on resume
can't have it both ways blocking directories from filename
makes shortcut folders browse into the folder but blocks
the folder when the file browser loads it causing you
to be in the wrong folder upon resume

I wanted a way for the user to be able to leave the slash off
so ensure shortcut folders have a trailing slash (on load)

Change-Id: I9ea173a90a8c12291a159e7d30ee1076e0ca5d3e
2025-02-15 02:47:14 -05:00
William Wilgus
922a2a4f3d tree.c optimize bookmark_play()
optimize the index search loop using mod()
instead of checking index and then scanning we can start at index
and roll over saving a compare in the process

Change-Id: Ie54fbf1ca0131db8914985b654248eeb8d725a82
2025-02-12 02:29:30 -05:00
Paul Sauro
fa5d2f3edf Database view is fully translatable and entries can be voiced.
* All tagnavi.config entries pulled into language files
 * Database viewer looks up LANG_IDs from the entries
 * If we find a match, we can translate and voice these entries
 * Add (disabled) mechanism to allow voicing database metadata

Original patch by Paul Sauro
Modifications by William Wingus
Further modifications by Solomon Peachy

Todo/Problems:

 * Current Tagnavi headers are rather awkward in English
 * Can't voice the "By first letter" alphabetic entries
 * No mechanism for generating talk clips for DB metadata

Change-Id: Ic276ccda1bd8aae550d38be852bae4c6f697cd47
2025-02-08 12:14:32 -05:00
William Wilgus
f3a858e16c [bugfix] tree.c rockbox_browse dirfilter use after free, set_current_file_ex
rockbox_browse() set its own *dirfilter and then may neglect to restore it

set_current_file_ex()
can take a unified path and file or separate path and file

only issue is when you send a folder and don't have the final slash
its then interpreted as a file and current file is set to it
meanwhile path is split and you end up in the parent dir

instead if filename is null check if path points to a directory
if dir_exists(path) then we will use it as is and set filename to ""

Change-Id: I6beaa91141c1a4025cdfac5d6ba426137146c212
2025-01-21 22:10:46 -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
4f5c9d9759 fix regression: playlist name suggestion for db and pictureflow items
In 2c4c1b9, I missed the fact that we still need these,
so that slashes in names aren't interpreted as a path
separator.

Change-Id: I2df0745669c4673497a506a99e754c63dcba045e
2025-01-16 18:17:41 +01:00
Christian Soffke
2c4c1b9199 FS#12702: Fix illegal characters in suggested playlist filename
Issue had only been partially fixed in
3f3b738 by showing an error message

Change-Id: I91665ac826e0025fb80eadac31abffa03667cf62
2025-01-15 13:32:46 -05:00
William Wilgus
1a17b5cb8e tree.c small cleanup
Change-Id: Ifd254f195f92833398b3f752a55d258cf7718183
2025-01-15 00:00:41 -05:00
William Wilgus
7a281eca83 [BugFix] Tree doesn't stop scrolling on exit
https://forums.rockbox.org/index.php/topic,53862.msg248780.html#msg248780

add an intermediary function to stop tree_list scroll when changing screens

Change-Id: I7376ea28fb1e1bbc09fce83209e0147711af92b4
2025-01-13 19:39:04 -05:00
William Wilgus
c115cb9472 [FixRed] 4ce8963c50 tree.c Maybe?
Change-Id: If959f6bcffa9b7afdd2942edc1ea683d275bac72
2024-11-29 00:51:44 -05:00
William Wilgus
4ce8963c50 [COV] tree.c rockbox_browse potential NULL deref
ultimately its only used as a way to prevent reentry
but coverity correctly identified the possibility..

Change-Id: I4738e52782ad4cac6134394238345a0491a50382
2024-11-29 00:25:03 -05:00
William Wilgus
06986d27f0 Generate A-Z menus in the tagtree
this adds a new command %byfirstletter

%byfirstletter "custom_track" "Track A to Z" "title"
^ command       ^menu name     ^menu title   ^subitem

need a better name for subitem btw..

this patch also allows us to tell when we are in the BFL menu
by checking customaction == ONPLAY_CUSTOMACTION_FIRSTLETTER
we then enable spelling of the letters in the menu
it spells Numeric too but that shouldn't matter with the upcoming voice patch

Change-Id: I59815f697a4ef84a8cb540783b620d15f6670e00
2024-11-02 17:27:22 -04:00
William Wilgus
e6313e4b8e tree.c remove strlcat in favor of strmemccpy
moved a conditional for reload_dir vs strcmp

Change-Id: I1635014fbbc6b9b0905abc3f9c60bbd2a1d08762
2024-09-26 00:38:54 -04:00
William Wilgus
34e54b33f7 codestyle changes on g5911
Change-Id: I8e3b172686fe78d52a8b407193479d3af36ee536
2024-09-04 10:58:24 -04:00
Paul Sauro
c16dbbfd1f Reworks to the shuffle system to improve performance and allow fast shuffling from a big library (but this work for all database views)
This improvement brings a huge performance improvement to start a random mix of your library. Previously, the only way to do this was to increase the size of a playlist with absurd sizes number. Now it will respect the limitation but will insert random songs from the current view.

Database: Add true random songs in playlist if it is gonna exceed its maximum capacity

More context is available here : https://www.reddit.com/r/rockbox/comments/1ez0mq4/i_developped_true_full_library_shuffle_for/

Also :
- Improved layout in the DB browser
- New default max playlists capacity is now 2000 on old PortalPlayer targets to give a better user experience and not having to wait dozens of seconds while creating a playlist
- "Show insert shuffled" option is now true by default
- Add a new shortcut to play all songs shuffled in the DB browser
- Now the feature is fully optional and enabled only on targets that have more than 2MB of RAM
- Add entries about this feature in the manual to explain it to the users
Change-Id: I1aebaf7ebcff2bf907080f1861027d530619097c

Change-Id: I3354923b148eeef1975171990e814a1a505d1df0
2024-08-31 10:44:20 -04:00
Solomon Peachy
78283bda64 talk: Voice the volume name when browsing and when voicing full paths
Change-Id: I56660e168edd135a09cd5c021504a58ec9d40093
2024-07-28 16:54:33 -04:00
Christian Soffke
9a84e9eb34 tree: fix return to root after adding to existing playlist
When adding files to an existing playlist from
the database or file browser, Rockbox returns to
the root menu afterwards.

Appears to be a regression introduced in commit 72c539d
for the file browser. For the database, it has only
become noticeable since commit 188f025

Change-Id: Iac48fe74d20d25f083005f6ebff5abc7ee425080
2024-07-22 15:56:00 -04:00
William Wilgus
188f025f51 [Bug Fix] Data Abort on Usb Unplug, database browser ran on USB dc
current_lists holds a pointer to whatver the current list is only problem
is when in one of the function type menus like the plugin viewer, playlist viewer, shortcut menu
probably a few others on usb unplug current_lists holds stale data and updates the list however
the data has already been freed when the function returned

the issue with db browser was a return of true from dirbrowse() which was the value 1 which is the
enum for GO_TO_DBBROWSER

Change-Id: I7349dfab2752e11f8e746925501740e959851cd5
2024-07-21 01:45:25 -04:00
William Wilgus
5c7fbe8f1b [coverity] tree.c set_current_file_ex explicitly check strrchr output
the math
        size_t endpos = filename - path;
        if (filename && endpos < MAX_PATH - 1)
should handle it just fine coverity doesn't think so

Change-Id: Ifa0494e56b40c8ab0081ebc771024a45cb24eb76
2024-06-02 10:41:50 -04:00
Solomon Peachy
5d34887d4a voice: regression: Don't mangle the filename when spelling it out.
26c612f breaks file selections if you have filename extensions disabled
and filenames spelled out, because it modified the filename in place
breaking the caller.

Instead of using a lot of space to make a private copy, the simplest
approach is, if we strip the extension off, simply restore it
afterwards.

Change-Id: Iaf560e813053b8030c620bbed6d061a2423338d5
2024-06-01 18:27:09 -04:00
William Wilgus
d7c541742f Allow first level folders in plugin menu
add sorting directories as files
move picross files to a hidden folder

use directory for lua_scripts, sgt_puzzles

make plugin browser able to handle 1st level directories

Change-Id: I30852d71dc992c378d5790756e94f06f5a2e9bef
2024-05-05 14:01:43 -04:00
Solomon Peachy
26c612f6c0 FS#13348: Don't voice/spell out the file extension if it's not displayed
(This only applies if there is no talk clip for the file)

Change-Id: I0f071313f480052ecf4b912919155a8f0c2430d1
2024-04-26 10:01:30 -04:00
William Wilgus
fdc3668a6a [BugFix] Multiboot Database duplicate files
When the sd card is mounted into the root namespace the database
picks up files through both paths

previously we hid the mounted drive but this causes issues with users
databases when the drive letter changes

Adds a way to keep track of volumes mounted in the root namespace

Hides the enumerated volume in root

Database:
we can just parse the root directory ('/') and get to any mounted
volume but we can also enumerate a volume in the root directory
when this occurs it leads to multiple entries since the files can
be reached through multiple paths ex, /Foo could also be /SD1/Foo
Instead we will attempt to rewrite the root with any non-hidden volumes
failing that just leave the paths alone

Change-Id: I7bdba8cfaf63902d2a3852d28484bcf8ca317ebd
2024-03-23 01:03:33 -04:00
William Wilgus
53a47970e3 [BUGFIX] some files wouldn't run as shortcut
make sure we have a chance to get the dirfilter otherwise
it may be rejected

adds some sanity checks and safeguards too

Change-Id: Ibdad288ace0c8bf6ac7b8f46722a43aebead829e
2023-11-23 12:26:08 -05:00
William Wilgus
5c60975d4f Revert "Revert "tree.c cleanup update_dir()""
This reverts commit b6ac9a9f39.

Reason for revert: RED Herring 

Change-Id: I96ea6cf15ba00b0faa8ce58dbbdde7d64973e119
2023-11-22 18:58:51 -05:00
William Wilgus
b6ac9a9f39 Revert "tree.c cleanup update_dir()"
This reverts commit 1d2dfb3a76.

Reason for revert: crash on ipod Classic boot

Change-Id: Ie0fe569515f73bb7853796e5e7df13fde42e8642
2023-11-22 13:43:53 -05:00
William Wilgus
1d2dfb3a76 tree.c cleanup update_dir()
Change-Id: I46a78a3df5ec76a5cd3ae1d6bb236fa40ae75533
2023-11-22 11:50:15 -05:00
William Wilgus
72c539d35e [Bug_Fix] shortcut to directory in .link files caused crash
since the plugin browser is now closed when running plugins
rb->set_current_file() had no valid browser context and used 'random' memory
instead

also adds a way to discard levels so we can load the desired directory
instead of returning to the previous

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

Change-Id: I624246e56d42972bf6a1ce566a209b745de6f30b
2023-11-22 00:52:58 -05:00
Aidan MacDonald
7ccbd705f4 playlist: Rework playlist modified detection and dirplay
The modified state is now an explicit flag that has to be
set whenever a user-triggered modification occurs. This is
recorded in the control file to ensure it doesn't get lost
after resume. There may be some places I missed where the
modified flag should be set/cleared, but it seems to work
well enough right now.

Change-Id: I3bdba358fc495b4ca84e389ac6e7bcbef820c219
2023-10-01 11:05:29 -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
0c29d1788e [Bugfix] open_plugin_browse() not showing plugins
rockbox_browse() overrides the desired dirfilter with
global_settings.dirfilter if you aren't using one of the
SHOW_ modes > NUM_FILTER_MODES (which come with their own sideeffects)

add flag BROWSE_DIRFILTER to
override global_settings.dirfilter with browse_context.dirfilter

add ability to set tc->browse to NULL to exit dirbrowse immediately

Change-Id: I2f40d394f9dc0864b2041293eda219f7436a7bf0
2023-03-18 04:23:43 -04: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
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
William Wilgus
c6c1d62489 [Bug Fix] filetypes.c move voice data out of INIT_ATTR
tree_get_filetype_voiceclip is called after init it shouldn't be marked as INIT_ATTR

add _init to the functions & data that are used at init only to be a bit more clear

Change-Id: I8eb1914560b782c2c0fdd7649e761f94e382d5cb
2022-12-13 22:35:24 -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
66a411a1ba Tree / Playlist Viewer / Menu: Fix redraw issues
1) Tree_lists was only initialized when booting the player.

In cases where a skin used custom UI viewports of
different sizes, when switching between screens, such as
between root menu, QuickScreen, and tree browser, this
caused list titles to appear with a significant delay,
unless a GUI_EVENT_ACTIONUPDATE was sent.

Tree_lists is now initialized when entering dirbrowse
or when restoring/reloading the list.

This eliminates multiple redundant UI refreshes when
entering the tree browser, due to gui_synclist_draw not
being called twice anymore and by being able to omit
GUI_EVENT_ACTIONUPDATE.

Separate calls to gui_synclist_init_display_settings
have become unnecessary since it is already called
by gui_synclist_init.

2) The synclist is also re-initialized when returning
from the QuickScreen in the Playlist Viewer or
regular menus, or when returning from Settings
menus

Change-Id: I2884249eda55f782e97abad9dc19b3d9d1267fc9
2022-12-08 00:38:59 -05:00
Aidan MacDonald
98c7505c60 tagcache: move TAGCACHE_STATEFILE define to .c file
Provide a function to remove the statefile so that external
users of this define can call that instead.

Change-Id: Id3e1e0564b25fe28bbc68c2e9365d8bf51e6e4f8
2022-12-03 06:34:47 -05:00
William Wilgus
1561b4ec9a filetypes.c clean-up
make icon a voice struct one

Change-Id: I44df788d03e38fe1bca7ea50f32c8dc5941405ab
2022-11-22 15:19:45 -05:00
William Wilgus
19aa4ca276 tree.c spell names AFTER voicing filetype
Change-Id: Iff2102c2993593f7b3c24f131c0f67f45c870bc7
2022-11-21 23:05:01 -05:00
William Wilgus
d077fec5f1 tree.c move voice filetypes to its own conditional
Change-Id: I3a5171378355e64192de1e29f62d52e03771afe4
2022-11-21 22:54:54 -05:00
William Wilgus
efdc6feddb move inbuilt_filetypes.voiceclip to a separate struct
there are a lot of duplicated voiceclips in the inbuilt_filetypes struct
its already looked up so deduplicate

Change-Id: I7846277d2da308f605d5564e9081d6077e697239
2022-11-21 23:52:59 -04:00