Commit graph

36488 commits

Author SHA1 Message Date
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
Christian Soffke
51c1e3ce7f Shortcuts: Fix return to wrong menu
Rockbox would go to a previously selected
menu instead of returning to the current one
when leaving the Shortcuts screen.

Change-Id: I3546e32def9124956cd9edc258e14db91d19fa22
2022-11-04 16:09:07 -04:00
William Wilgus
8cbe5c95a9 screen.c remove unused getstringsize
getstringsize on SEPARATOR was overwritten by another call to
getstringsize

lang files use position to decide target strings 'RTC' was after targets using
different buttons therefore in error gained precedence

Change-Id: I40edc6c99140ac81bffd4c47d5e055ebc94ab1b2
2022-11-04 15:35:24 -04:00
Christian Soffke
9da3044cf7 Database: Remove firstpos/pos_history
From what I can tell, this is unused historical
baggage that has no effect whatsoever these
days.

Change-Id: I1b6fed64e7bf5cc4db4ec028617c818c59d81324
2022-11-02 07:19:36 -04:00
Christian Soffke
ca908d6336 Database: Fix FS#13368 – use separate selected item history
Database and File Browser were sharing
each other’s selected item history before.

Since the database isn’t browsed
recursively, it’s probably unnecessary to
include its own history in the tree context
and its backups, saving.a little bit of memory.

Change-Id: I87c9aed6f7056bc481b8b7299089851ef28f9bc5
2022-11-02 07:19:36 -04:00
roman.artiukhin
59f3f43d10 Exit Shortcuts on ACTION_STD_MENU
It makes it behave consistently with tree/playlists other menus. So it's possible to exit Shortcuts using Back button on Clip Zip or Power button on Rocker

Change-Id: I8a52422ed2d96d0727ddacf364f87878735c6e4c
2022-11-02 06:55:19 -04:00
Aidan MacDonald
4e60fb77e0 codecs: mpa: Improve seek & resume accuracy for VBR files
The codec used 32-bit math for elapsed time <-> file position
calculations. The rounding errors seem to be the cause of poor
seek/resume accuracy on long VBR files; switching to 64-bit math
makes things much better.

Change-Id: Iba638d9e031a891022510c31c141cc4541e3f149
2022-11-01 09:52:34 -04:00
Aidan MacDonald
26ffcd8f9f playback: Fix track resume from file offset
Resuming a track with "Resume Playback" or a bookmark is supposed
to pass both the file offset and elapsed time to the codec. Since
commit dfff938dff the offset has been getting zeroed because the
buffer handle wasn't open at the time of the buf_filesize() call,
causing it to return a negative error code.

Having a valid offset improves resume accuracy with some codecs,
like VBR MP3.

Change-Id: I8af7f001644f1ee1bd27ca3049a4cff2d2274149
2022-11-01 09:52:34 -04:00
roman.artiukhin
0d30356734 Refactor to reuse seek code for resume by time
It fixes Playback/Bookmarks Resume for long vbr mp3 files
It also fixes resume by time for asf files.

As a replacement for https://gerrit.rockbox.org/r/c/rockbox/+/4750

Change-Id: Iaa59b5862385f5fe91fdc2fb0b1fde8ce75c0b54
2022-11-01 09:23:35 -04:00
roman.artiukhin
5d7e15324b Fix tree scrolling not showing end of text
Fixes FS#13243

Change-Id: Icc9fa1e92ca5c928f90ba1a8291bdf37a6fe7898
2022-10-30 14:11:20 -04:00
roman.artiukhin
4193436000 Add more space for displaying time on WPS for Clip Zip
Replacing " of " with "/" allows to avoid overlaps for  > 20 hours long audiobooks

Change-Id: Ib7628fc5af9f77fd30fe2c4fc3d67d18eda5c0b9
2022-10-30 12:01:42 -04:00
Christian Soffke
246152a671 Database: Fix possible crash
The File Browser and Database apparently share
the same selected_item_history, which means that
selected_item can be -1 even in the context of the
database,

This leads to tree_get_file_position being called in
id3db mode, which isn't safe to do.

Change-Id: I46151e8a823afab0b57ad839cde13f6072b8917b
2022-10-30 11:57:33 -04:00
Aidan MacDonald
b4e7c60c6d Shanling Q1: Disable recovery kernel boot option
The Q1 handles firmware updates by unpacking the firmware image
from the player app, then rebooting into the recovery kernel.
The recovery kernel reflashes the player kernel and rootfs with
the unpacked update files on the SD card.

Booting the recovery kernel directly is therefore not useful to
the vast majority of users; remove the option from the recovery
menu and remove the key combo.

Change-Id: I6cebfb6a3514ff2ae7d6f3904ac93b481773799b
2022-10-29 12:51:05 +01:00
Aidan MacDonald
a5b08d0af7 Shanling Q1: Support OF-initiated firmware updates
It's now possible to install OF updates on a rockboxed Shanling Q1.
Previously these didn't work because the RB bootloader interrupted
the update process.

Updates will proceed as they normally do on a non-Rockboxed Q1,
except at the end of the update you'll reboot to Rockbox instead
of the OF. This is only a minor inconvienience and doesn't affect
the update process.

Change-Id: I0f8fc96f073c50c1512bf60e0927491be8178eb0
2022-10-29 12:51:02 +01:00
Aidan MacDonald
d09fb6bb6b x1000: Pass CPM scratch register to the bootloader
Change-Id: Iaef4606dc6f3cb9904d87ee92db69fb9ef48bcb0
2022-10-28 20:58:26 +01:00
Aidan MacDonald
744ea2ff43 x1000: Allow SPL and bootloader to pass arguments to next stage
Change-Id: I61591d704c14acf06cd192a6e9355f0a9c25d0d8
2022-10-28 20:32:38 +01:00
Aidan MacDonald
9e258652c4 x1000: Add a basic sanity check for bootloader backups
The bootloader backup is intentionally simple, but it's a little
*too* simple. Add a sanity check to make sure what we're backing
up or restoring contains the first 8 bytes of the SPL header.
This isn't going to catch all possible problems, but it'll stop
obviously non-functional backups from being restored.

Change-Id: I6e80351aeb96c467f0514bd0ecd77d94ff72a8f8
2022-10-28 20:32:38 +01:00
roman.artiukhin
202eb8c06a Fix wrong formatting in WPS
Fixes FS#13354 and FS#12980

Change-Id: I4ec4cb57cfb64494e633d0bb92e733d92593c075
2022-10-27 18:21:49 -04:00
Aidan MacDonald
4b7b7a0a83 shortcuts: Reduce SHORTCUTS_PER_HANDLE to 4
The current value of 32 per handle seems excessive. Buflib overhead
per handle is only 20 bytes and a single shortcut is > 500 bytes.
Reducing SHORTCUTS_PER_HANDLE means that minimum memory usage can
be lower when there are a few shortcuts, at the cost of marginally
increased usage for large numbers of shortcuts. This is helpful to
keep memory usage under control for low-memory targets, where 16 KiB
is almost 1% of system RAM!

Change-Id: I47dbe0da874ae512cf50a0bd8350576ab2fabdf4
2022-10-27 11:10:47 +01:00