Commit graph

36556 commits

Author SHA1 Message Date
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
Christian Soffke
8fe42c43c6 WPS plugin hotkey: Fix UB
HOTKEY_PLUGIN action resulted in return value
of void function being assigned and then returned
by execute_hotkey.

Change-Id: I8b141e878fc2c0b09070186fc3520314c18a83b0
2022-11-19 22:19:15 +01:00
Christian Soffke
dcde5aa89d Database & Playlist Viewer: Fix return to WPS from plugin
After calling up PictureFlow from the database or from the
Playlist Viewer, you would not be returned to the WPS as
would be expected when picking a new song, selecting
"Go to WPS" or pressing the WPS action button.

Change-Id: I902ac9185ebe092d0c4c08804db0a813a32cc39c
2022-11-19 17:08:39 +01:00
Christian Soffke
b3a464c9d1 Playlist Viewer & Catalogue: Go to WPS when ACTION_TREE_WPS is pressed
Change-Id: Id69253beadcc203ea0e2d16e5acc353aee0f6ad4
2022-11-19 13:39:58 +01:00
Christian Soffke
3d34140cfb Fix return to root after selecting items from playlist viewer
When selecting an item, Rockbox only checked that
playback was stopped before entering the viewer and
went to the WPS if music had started playing afterwards,
but returned to the root menu otherwise

The WPS will now be displayed whenever a new item has been
selected, even if audio was paused or playing before.

boomark_autoload required slight adjustments to its return values,
so that the WPS would not be opened after a user cancels out of
the bookmark selection screen for a playlist, since it  previously
returned true in that case, too.

Change-Id: I231ea788e2f80fdda5fe4ad4d2420450931f686f
2022-11-19 10:01:23 +01:00
William Wilgus
3b1230b365 talk.c add busy loop to talk_spell
talk spell can lose the remainder of the words on longer sequences

Change-Id: I5f8f0f42d780ea9d1f00d99ff32746be34c27745
2022-11-19 02:13:51 -05:00
William Wilgus
b0ccb1b95f talk.c clean up
Change-Id: Ie06859c80e9ca14bf3e4a23b82d3d1c76263b2b8
2022-11-19 02:12:09 -05:00
Aidan MacDonald
38687821b2 skin engine: Remove playlistviewer viewport field
We already know the viewport at render time (I think... at least
this seems to be the case for themes I tested) so there's no need
to store a pointer to the viewport.

Change-Id: I75fa2262e96c6f735e6b5da33cd4ca9ac68cd2ee
2022-11-17 16:12:19 +00:00
Aidan MacDonald
7de16eee26 viewportmanager: Fix missing void in function definition
Change-Id: Ibc56e3ce92b4559fd310843a0761e7bfb6511e1d
2022-11-17 16:12:19 +00:00
Aidan MacDonald
15b36a02b1 Remove get_viewport_default_colour()
The function isn't used except for the skin engine's %Vf/%Vb tags,
so inline it there and remove the separate function.

Change-Id: Ia207321877234bc3679457c820a4292ae53f3520
2022-11-17 16:12:19 +00:00
William Wilgus
016090b2a4 Bug fix multiboot.c get_redirect_dir didn't reach index 0
add_path[0] was never reached

Change-Id: If375a70832b0666d87f7d87b136cc377484b9ec1
2022-11-17 05:36:55 -05:00
William Wilgus
7b3e2f6f85 fix yellow iap-core.c
Change-Id: Idebedd10962e358002ea1a3dd6ae491e59c44ecb
2022-11-17 04:43:38 -05:00
William Wilgus
00f915d92e strnatcmp.c use a fn pointer to call strcmp/strcasecmp
Change-Id: I2bfaeec4cf2af4bed8f0781bcfa24b0b104fb22a
2022-11-17 04:15:38 -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
0b7a387671 open_plugins add name when plugin can't open & check LANG_LAST_INDEX_IN_ARRAY
can't open '' was confusing for users so pass the key to open plugin
in theory you could have a plugin that defaulted to these lang_ids
run but its good enough to tell the user what failed to open IMO

lang_id changes mess with open_plugin since it uses them as look-up keys
so add checks for LANG_LAST_INDEX_IN_ARRAY to the checksum

the plugin now removes entries with an invalid checksum

devices with harddrives only append their .dat file so have them skip entries
with invalid checksums and only notify user if a valid entry wasn't found
(these users can run the open_plugins plugin to remove invalid entries)

Change-Id: Icf157675beaccda785643d5a9ed032a7cde30f12
2022-11-17 01:43:16 -05:00
William Wilgus
4c3937591c lua Fix potential event stack OVFL
you could return values in the event callbacks that would never be processed
this would eventually cause a lua stack overflow

settop(0) eats all return values (if any)

Change-Id: Icac6b27e592b385421275d4bd899ed3fe1065669
2022-11-16 20:54:30 -05:00
Aidan MacDonald
2f278af760 codecs: alac: Improve resume accuracy and clean up rounding errors
Resume by offset was obviously inaccurate for ALAC -- it tried
to convert the offset to an elapsed time using the approximate
bitrate, which is going to be wrong for VBR files. This became
a problem since commit 26ffcd8f9f restored the ability to resume
by offset.

It turns out that m4a_seek_raw() has terrible resolution since
it can only seek to chunk boundaries, and lies about the real
sample position; basically the same issue that affected seeking
described in commit 4dd3c2b33e. Resuming by offset is still not
very accurate because of this. Prefer to resume by time first,
which is normally highly accurate (and never worse than offset)
but use the file offset if it's the only thing we have.

There were a couple time calculations still using 32-bit math,
so clean those up too to reduce issues due to rounding errors.

Change-Id: Idd3bccd67505f4e59e784d92e45ea80a273975bb
2022-11-16 06:48:28 -05:00
Aidan MacDonald
ea61347a0b codecs: aac: Prefer to resume by time instead of offset
m4a_seek_raw() is relatively inaccurate, so time-based resume
should be preferred.

Change-Id: I959ef165f9a99d12deb804c13d20413c1cecf867
2022-11-16 06:48:22 -05:00
Aidan MacDonald
5fdd491ceb playlist: reduce memory usage for loading playlists
There's probably little benefit to using core_alloc_maximum() for
loading playlists since they are parsed incrementally. I/O speed
does not increase with increased read sizes beyond a certain point.
Read by 32 KiB chunks since that is what the buffering thread does.
Fall back to core_alloc_maximum() if a small allocation fails so
that buflib will try harder to free up space.

Change-Id: I08b94317d12b98af09ef2bd84aa1195c4c51d1b1
2022-11-16 06:47:38 -05:00
William Wilgus
dfa1539b13 Bug Fix test_viewports.c call scroll_stop before changing viewports
Change-Id: I0dd0374dfff7fef7e4f431e7231345ee1ae6cb2b
2022-11-16 01:49:41 -05:00
William Wilgus
7733abce29 strlcat use strlcpy for the copy part
Change-Id: I729b292a58d9f6542e58ac01d1dc90d36175886d
2022-11-16 00:36:47 -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
3ad8c0ad7b fix another non shadowed variable
another variable that shouldn't have been removed in 034b6d5b

Change-Id: Ie16aa2687cec7f55e9cc2477951c228de18755cd
2022-11-15 19:17:41 -05:00
Christian Soffke
be65ec2338 Fix menus in Settings
Commit 034b6d5b prevented other Settings menus
on the same menu level from being displayed after
accessing one item's context menu

Change-Id: I378e1748b7f449ad34042a3c8c626488fc07a7d4
2022-11-15 22:43:41 +01:00
Solomon Peachy
0458951464 translations: Update US English "translation"
Change-Id: I961f93c9668a2ddd424026321717d1c60d4e7d60
2022-11-15 09:56:07 -05:00
Solomon Peachy
cca954e427 FS#13363: Update Serbian Translation (Anonymous 'bugmenot' user)
Change-Id: I1be0bf36fe02f29f5136786d425dd6d88006b0f4
2022-11-15 09:28:26 -05:00
Solomon Peachy
90f6aa2afa FS13362: Update Dutch translation (Anonymous user 'bugmenot')
Change-Id: Iad3fa8e5853f31ecb85eacd7484b11e12c716759
2022-11-15 09:28:26 -05:00
roman.artiukhin
e68b727f4f Add more space for Time Elapsed/Remaining on Rocker WPS
Similair to 41934360. To display 20+ hours long audiobooks without overlaps.

Removed tag duplicates

Change-Id: Ibf95594000459d340e47849bc97286657a72da2d
2022-11-15 09:23:37 -05:00
Aidan MacDonald
73b1e30bb0 skin engine: Reduce scope of internal wps_data struct
A bunch of public API calls take a wps_data struct argument,
but that's an internal type that doesn't have a direct getter.
Instead the skin engine provides a gui_wps struct as a way
to refer to a particular skin instance. Use that instead of
wps_data in the public API.

Change-Id: I13e1aa8df7f08ccfb789bb728d493ac8d7de1a9b
2022-11-15 14:20:31 +00:00
William Wilgus
45bd4c7220 Fix last of red for strmemccpy
Change-Id: I76c421d938a879e57018e3f9706edf77c03de1b5
2022-11-15 01:58:28 -05:00
William Wilgus
687767bd8f convert a few more strlcpy to strmemccpy calls Fix Red and Yellow
albumart is imported to plugins just use a macro substitution
for now

Change-Id: I7c2e10d7559c087f0b3d0e6b844027d3b323da55
2022-11-15 01:24:26 -05:00
William Wilgus
aea324b746 Fix red strmemccpy CheckWps & Database
Change-Id: I88c5dc151010b6d8c01cd1a2a258f2923272acdf
2022-11-15 00:38:00 -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
b25a9d8f99 add memccpy.c
Not sure if this is worth the added bin size yet but I will
see where I can use it to try and make it worth it

Change-Id: Icc299d3986172ff224a14be48da3bf065d728a66
2022-11-15 00:56:01 -04:00
William Wilgus
034b6d5bfb Remove some shadowed variables identified by -Wshadow
there are plenty more but these are the low hanging fruit

Change-Id: I86d9f4f56e8cd9b381d1bf6a6679cd58c6a4004d
2022-11-14 09:01:43 -05:00
William Wilgus
f94a14b859 increase the number of file & directory handles for devices with more ram
Change-Id: I06f517b3b1388aa43fe1aa9edae53c92d0b137e8
2022-11-14 08:21:29 -05:00
Christian Soffke
c088a9453d Database: Restore selection in lower menu levels
The database only remembered what you'd selected when
ascending the menu hierarchy again from a lower level.

Now it restores a previous selection going in the other
direction as well, when you enter a new menu, as long
as the selection at the current level hasn't changed.

Change-Id: I5068287ff758a7cfebf1428e9b0ffd30e6ef541e
2022-11-14 05:47:10 +01:00
Christian Soffke
e6ab74d4ac Database: Eliminate redundant list item selection
- gui_synclist_select_item will be called in the update_dir
function by dirbrowse()

- it is unnecessary to call when the tables opened by
tagtree_enter are not being displayed but are only being
used for inserting table contents into the current playlist.

Change-Id: Ib768b457b2baa7eb85cf73c6339fd4f603d03d90
2022-11-14 05:36:46 +01:00
Christian Soffke
97936e0661 Database: Fix problematic dirlevel reset
Dirlevel is restored in this error case without
exiting the previously entered tables.

Change-Id: I516c3ed635bc5c49dcf551223258215f79bff046
2022-11-14 05:35:28 +01:00
William Wilgus
a634557a88 fix strptokspn, add strcspn, fix splash.c
fix off by 1 error in strptokspn, add strcspn, fix fallout in splash.c

Change-Id: I61475d9633fc35db5a8ae30cbe588f69f2f7fabc
2022-11-13 01:14:49 -05:00
roman.artiukhin
ffe2df2e92 Implement Rewind across tracks functionality
Useful feature for audiobooks. To rewind from the end of the previous track - press rewind at the very beginning of the current track. So if you are in the middle of the track - first rewind till beginning then release and press rewind button again (Playback Settings -> Rewind Across Tracks option should be enabled)

Fixes FS#13290

Change-Id: I5d7f06f64ad76d1e8f7827fe594ccca5f621769d
2022-11-12 09:13:19 -05:00
William Wilgus
30ec10c790 splash.c Fix yellow const char
Change-Id: Iac4ab74d9fb7a290f44ae53a1865ec65b9008c43
2022-11-12 07:15:13 -05:00
William Wilgus
c756a8a89d make splash split on control characters
splits on spaces also considers \r\n\f\v\t as mandatory breaks

I'm still working on the strptokspn function
my goal is to use it directly rather than storing the matched char
and modifying the source string with \0 in order to tokenize the output
--Done

Change-Id: I7f378b5b9c4df8f10899b9a55a98950afb3931dc
2022-11-12 06:22:16 -05:00
William Wilgus
dd1fbd51fc TagTree Show file name for tag_title [UNTAGGED] BugFix
limit result to tags that only show <UNTAGGED>

Change-Id: I56ff4ea8c5a17df806d69d58599a9a88f8acc4b0
2022-11-11 18:36:07 -05:00
Aidan MacDonald
06f0465158 skin engine: Remove touchregion argument from skin_get_touchaction
Nobody uses the argument, and it exposes internals unnecessarily.

Change-Id: I376dc75db99ed89671175f906980526a23be70f6
2022-11-10 07:08:35 -05:00
Aidan MacDonald
56389b21b1 skin engine: Remove gui_img viewport field
This is set but never used.

Change-Id: Ifbeaa843ef070ea178cc270ffcade0d57a4fb45f
2022-11-10 06:37:41 -05:00
Aidan MacDonald
2c1adac3f8 skin engine: Remove unused viewport_change flag in skin rendering
Change-Id: Iad4487854d005a33184febf6cf97924b21010f6b
2022-11-10 06:37:41 -05:00
Aidan MacDonald
37da608f84 skin engine: Remove weird special casing for Onda VX747
I have no idea what bug this could possibly "fix", and nothing
looks different on the sim after removing it. As far as I can tell
the Onda has no unique features that could cause the skin engine
to act flaky, so I'm willing to bet this workaround isn't needed.

Change-Id: I2c183786948f3fe9778e04134d04bdfe3c6db543
2022-11-10 06:37:41 -05:00
William Wilgus
c2220a3b50 eq_menu cleanup some getstringsize calls
remove some unused calls and save some space by only grabbing font h once
it doesn't change throughout the function

Change-Id: Iec3b8b34150d15b36062cba59c8d365b751bd0f6
2022-11-09 11:58:17 -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