Commit graph

16932 commits

Author SHA1 Message Date
Aidan MacDonald
ec1611dfa6 Add a comment about the ordering of 'enum playmode'
Change-Id: I1f259afaa2d0212c5bedba41380e51b9a911aaaf
2022-11-23 10:08:49 -05:00
Aidan MacDonald
9f09cdc9b8 skin engine: Streamline handling of the %mp tag a little
current_playmode() returns a value from 'enum playmode' and we
can take advantage of the enum values to simplify the code.

Change-Id: I368ec38ba5061f6cc6d3382e536db2312b27d643
2022-11-23 10:08:49 -05:00
Aidan MacDonald
3815ef8050 skin engine: Remove albumart viewport field
The viewport field in albumart is unnecessary, but for a different
reason than eg. the progressbar was. The skin engine draws images
by going over a global list of images shared between all viewports.
Prior to drawing a viewport, every image is marked "not displayed."
When an image display tag is encountered during rendering this mark
is set to the index of the subimage to be displayed.

The albumart is handled similarily, by setting a handle to -1 and
then updating it when the %Cd tag is encountered. The albumart is
not drawn unless the handle is set to >= 0 by the %Cd tag. So we
don't need to track or check viewports at all, because only the
viewport that contains the %Cd tag will ever draw the albumart.

Change-Id: Ibc0233d168012759325d3c16dc317de9ad3dcf6c
2022-11-23 10:07:29 -05:00
Aidan MacDonald
830436a282 skin engine: Remove viewport_colour viewport field
Yet again, no need to store the viewport because we already know
it -- and this time the render code is obviously relying on that
assumption.

Change-Id: Id5eb7cd9999fbe1efccd54bd8f0fd3c8a3011c8e
2022-11-23 10:06:16 -05:00
Aidan MacDonald
9368844ad1 skin engine: Remove progressbar viewport field
Again, we don't need to store the viewport in the progressbar
struct because it's known at render time.

Change-Id: I12514ceaace7c897194b18929364340871ef4635
2022-11-23 09:44:23 -05:00
Christian Soffke
f242b0ec6c Settings/System/Plugins: Go to WPS when ACTION_TREEE_WPS is pressed
Used to go to root menu before.

Change-Id: I5c0e0cb204cb3979917dde0f243185c32ef4177a
2022-11-23 01:24:59 -05:00
Christian Soffke
17cae50497 PictureFlow: Add hotkeys for changing sorting on iPods / Update manual
Adjust current sorting by pressing both
the Select button and Menu (or Play)
at the same time.

Change-Id: I474b79a16e278d34e3983384125015bdfb6f484a
2022-11-23 01:24:59 -05:00
Christian Soffke
0c7f66ab5f Playlist Viewer: Display playlist name in title
Change-Id: I7b258a566f55d026710d3441d1b4188f7614c5ee
2022-11-23 01:22:14 -05:00
Christian Soffke
6bc443f474 Hotkeys: Add placeholder for function return value
Seems a bit clearer to me than redefining the meaning
of ONPLAY_OK in this context, which was easy to miss.

Fixes the return value for the bookmark_create_menu
hotkey, too. It was previously mapped to ONPLAY_OK
in case the function failed, and to ONPLAY_RELOAD_DIR
if it succeeded. This had no ill effect - or any effect –
since either of the values were disregarded by the WPS
when executing a hotkey.

Return values of playlist_insert_shuffled also had no
effect (by design, apparently, see commit 482b45b).
Use ONPLAY_FUNC_RETURN in hotkey_assignment.

Behavior hasn't changed, it's only been made more
explicit.

Change-Id: Iefc60c9f42c1063af78d368dc382916848064d38
2022-11-23 01:22:14 -05:00
William Wilgus
0d355a9c47 filetree.c add back SORT_ALPHA_REVERSED
this is used for the playlist folder advance

Change-Id: I9da826d39c1a5880f6b97c33389afd601ce07834
2022-11-23 00:51:54 -05:00
William Wilgus
263cc13985 tagtree.c move sort_inverse out of compare function
Change-Id: I9c91a96a45fe98d51d27974bc2d6d79eaa5039d3
2022-11-22 19:14:26 -05:00
William Wilgus
2a9482ad7c filetree.c move sort functions out of cmp function for SORT_ALPHA
move sort function decision out of the compare function

Change-Id: Ibc26ebeaf409048efa92cb611edc223ed73c9e39
2022-11-22 18:38:58 -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
dc47bf8ae2 BUG FIX settings_list.c
fix dumb mistake reordered mavro args instead of just struct args

Change-Id: I0067d6c9fb9e00a927d2936629981fd5a15f705b
2022-11-22 02:19:06 -05:00
William Wilgus
5240202226 filetypes.c put attr mask back
not totally sure of the implications but this mask should be here

Change-Id: I605841a4ec41a2ffbf7b0f6eeaf142068577b919
2022-11-21 23:28:23 -05:00
William Wilgus
b40dff510a cuesheet.c guard against invalid digits causing underflow on field ASAN
is digit checks for invalid fields but could possibly check field = -1

Change-Id: I5f6bc5047b1ec0bf122d360f8eb86e64a2784bef
2022-11-21 23:24:30 -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
William Wilgus
2056878e46 move inbuilt_filetypes.icon to a separate struct
there are a lot of duplicated icons in the inbuilt_filetypes struct
its only used at load so deduplicate and look-up by attr

Change-Id: I5eb34e5243d88688984f689e0add08f92d953a6f
2022-11-21 21:27:10 -05:00
William Wilgus
658cc95885 remove some sprintf putsxy calls in favor of putsxyf
we now have putsxyf in screens[] so no need for a separate
buffer in these cases

Change-Id: Ife0738e731f03d255f512bab3d5bb07b8be8693d
2022-11-21 00:25:12 -05:00
William Wilgus
0661784469 make int_setting step & unit int16_t
since int_setting is the largest struct in the union of settings
saving 32 bytes adds up over every setting

frees ~200 bytes

Change-Id: Id4722262e40db3021c740e138fe7352be10e2c70
2022-11-20 13:57:09 -05:00
Christian Soffke
b7603adc64 Properties: Refactoring & Minor fix
- Extract functions for
* determining whether it's a file or dir
* showing stats for dir or file without id3

- Remove typedef for struct
- Fix unit string not being displayed correctly during scanning
(use %s instead of %cB)

Change-Id: I31440ebd96bca791a96c66511c3de9727608218a
2022-11-20 00:41:10 -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
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
7b3e2f6f85 fix yellow iap-core.c
Change-Id: Idebedd10962e358002ea1a3dd6ae491e59c44ecb
2022-11-17 04:43: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
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
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
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
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
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