Commit graph

17126 commits

Author SHA1 Message Date
Aidan MacDonald
90bc76956c Ignore trailing whitespace in settings .cfg files
Have settings_parseline() strip trailing whitespace from
the setting value.

Fixes a regression introduced by 5b1dd64f5, which caused
filename settings to be parsed incorrectly when there is
trailing whitespace in the .cfg file.

Change-Id: I6c54428f6467ea2d169d2a7449705b40627e1a40
2022-12-07 08:44:18 -05:00
William Wilgus
fceb4f6292 misc.c format_time_auto() make several const tables static
Change-Id: I597eee8f2d531d4cc2ec69dd8bc78f8cd7950162
2022-12-07 01:40:49 -05:00
William Wilgus
152a238947 playlist add mutex to public functions
mutexes are in just trying to refactor the rest and make it a smaller
and more robust system

--Done

Change-Id: If64807c3e0ee1966f7593795f26f1f538caf831b
2022-12-06 23:40:02 -05:00
Aidan MacDonald
a89f279fd4 settings: Clean up NVRAM code
Code style fixes, tighten error checking, replace a static buffer
with a stack allocated one.

Change-Id: I48392fa187057cc4a07847d45147f0db9f43f509
2022-12-05 14:18:06 -05:00
Christian Soffke
961e73b3a1 Addendum to d3d2045
Forgot to remove this...

Change-Id: Ifc97e47bb3923554030296097ef46352dad6eff1
2022-12-05 07:53:25 +01:00
Christian Soffke
d3d2045cab Bookmarks: Fix redraw issue in Select Bookmarks screen
Parts of the skin weren't redrawn after deleting a bookmark.

Change-Id: Id06fb95a6d3740340df989bcb9827fe3a87bb296
2022-12-05 07:28:21 +01:00
Aidan MacDonald
1e6c8d2ea6 skin engine: Settings ID to pointer conversions
Convert %St tag to operate on settings pointers instead of IDs.

Change-Id: Iabf4c280be82b495a64b560b59620fb477e0c738
2022-12-04 11:19:57 -05:00
Aidan MacDonald
4ff97ae07c settings: More settings ID to pointer conversions
Convert cfg_int_to_string(), cfg_to_string(), settings_write_config().

Change-Id: Icb72d2ff874cf90ffe5fe14878aece0a53f6bd18
2022-12-04 10:46:02 -05:00
Aidan MacDonald
bbe3942039 settings: Settings ID to pointer for cfg_string_to_int()
Accept a pointer to struct settings_list instead of an index in the
settings array. Refactor the skin engine's touchregion_setup_setting()
to avoid the use of indices.

Change-Id: I784a5e49205da6874b8b419dd5413f722ad45b67
2022-12-04 05:25:50 -05:00
Christian Soffke
0550c64226 Bookmarks: Fix autoload return from bookmark selection
- Fix placement of parentheses from commit 780990
- Return cancel when play_bookmark fails or user declines
to erase dynamic playlist after warning
- Go back to Playlist Catalogue when user cancels out of
screen

Change-Id: Ibe8c315bdf8c6c9e696f68541b5d4d97dc0e778a
2022-12-04 05:38:50 +01:00
Aidan MacDonald
879b5dae39 Fix red 8f582c90de
global_settings is not defined when building the database tool.
Add a path buffer in tc_stat to fix this. This also avoids race
conditions that may occur if changing the path setting at runtime.

Change-Id: Ib2ca92c2e34929c79b19ef145fd7ccdcd62c8d04
2022-12-03 13:13:16 +00:00
William Wilgus
3957aa8720 RFC BugFix tagtree.c reload data abort
TagNav.lua adds Reload to the Custom View menu of tagnav to allow users to make new search queries on the fly
previously you had to reboot the device to do this

I was getting a data abort prior to calling tagnav_init now but it worked fine if I copy pasted
the contents of the init function

I'm not sure how this fixed it but making a static init function makes it work as intended
is it a race some weird thing with the compiler??

Ideas??

Change-Id: I7fd6c50f929d3ac2d9ecec5336942288e9213ad5
2022-12-03 07:41:33 -05:00
Aidan MacDonald
8f582c90de tagcache: add a setting for customizing the database path
Add a new setting,

    database path: /path/to/folder

to change where the database files are stored, which allows it to
be shared by multiple builds when using multiboot. This avoids the
need to maintain a separate copy of the database for each build.
This setting can only be set from the config file; it has no menu
option yet (due to lack of a GUI to pick the directory).

Change-Id: Ide7b3ccdd84abb62b52f900421bd3d101773e093
2022-12-03 07:29:42 -05:00
William Wilgus
f033fd390e Fix Red playlist update a few functions
Change-Id: I0d9b4c8f7e4b128dd7378c6b7515f8195534fce7
2022-12-03 06:49:07 -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
03c225fe54 playlist.c clean-up and organize
No functional changes

Change-Id: I5c7a4a63c54bc867b7d6c2ca6cbc8ef135e01a90
2022-12-03 06:28:48 -05:00
Aidan MacDonald
90dc64da32 tagcache: remove TAGCACHE_STRICT_ALIGN flag
This has been defined to 1 since forever, so the last remaining
check presumably isn't catching anything.

Change-Id: I0b60f831a6e5e8fc45788e7581fccb0cb62bce73
2022-12-03 11:00:35 +00:00
Aidan MacDonald
b6c2b54e01 tagcache: move most defines to .c file
Most of the defines in the header file are internal to the tagcache
and therefore should not be exposed in the header, to make it clear
that outside code does not depend on the values.

Change-Id: I83b0c83c61c755231e03719a6845a555f983194a
2022-12-03 11:00:27 +00:00
William Wilgus
177a15b2ed playlist_catalog remove static playlist_dir in favor of generation at runtime
this needs tested by the heavy playlist users

with the addition of initialize_catalog_buf there shouldn't be any stack overflow concerns
since we are no longer creating another max_path sized buffer when one is already available
this also simplifies the code a bit

rather than carrying around the playlist directory just generate it on the fly
copies the directory to the supplied buffer

add catbroswe_status to keep track of what browse context(s) are currently in use

Change-Id: I145ec501f601c84bb52f2241ed28c6aefab6897b
2022-12-01 22:29:35 -05:00
William Wilgus
773fa7874d RFC playlist.c add_indices_to_playlist() seek back to start of file
get_filename() changes the seek pos with out restoring it
seek back to the beginning or after the BOM if utf8
--
the other option is to open our own file descriptor this will
remove the need for the mutex but it would no longer block get_filename
from getting potential stale / bad data

Change-Id: I0d2b8a1a297c7aaf453b3bc558b2b5b53dbe591b
2022-12-01 17:56:31 -05:00
Aidan MacDonald
d7557e8da8 settings: Update doc comment for struct settings_list::cfg_vals
cfg_vals has not been used in conjunction with F_T_UCHARPTR for
quite a while.

Change-Id: I7f710201484ca25aab112897123afd07abdfd4c2
2022-12-01 14:24:51 -05:00
Aidan MacDonald
528dd0b03d settings: Remove redundant lang_id check for F_PADTITLE settings
All the F_PADTITLE settings use a lang string so it's safe to
assume the title (which is usually from the setting's lang_id)
is ok. Not like it's very useful or safe to show the cfg_vals,
anyway...

Change-Id: I0bf710e1b2a5a7bcdfe9e4370f48a2f25e8dddf0
2022-12-01 14:24:51 -05:00
Aidan MacDonald
fb0757b913 settings: Remove F_ALLOW_ARBITRARY_VALS from hotkey settings
The hotkey settings come from a fixed enum, arbitrary values are
not supported. It's not possible to use choice settings for them
because some enum values are only used in the WPS, and some are
only used in the tree.

Change-Id: I4647a8c02d960234323a7f2bbf31fee9f8c5b91a
2022-12-01 14:00:01 -05:00
Aidan MacDonald
8aa3b22160 settings: Update int fallback check for settings with cfg_vals
This atoi() was added long ago in commit d490f441, and it looks
like it's intended to allow arbitrary values in table settings.
These table settings have some symbolic values (eg. off, on) but
are otherwise int-valued.

As far as I can see the only settings that can take this branch
are all table settings with F_ALLOW_ARBITRARY_VALS. It doesn't
make a lot of sense to accept random integers without that flag,
so make the atoi() conversion dependent on it.

Change-Id: I7bb1bc4997601b73ad8dcbf2f3ddf434d16adf23
2022-12-01 13:59:49 -05:00
Aidan MacDonald
6346be51a3 settings: Clean up and simplify settings_load_config()
Use find_setting_by_cfgname() instead of doing it manually.
Reduce the excessive level of indentation.

Change-Id: I410fd7e0c26d065bc479dad3b6facfb5368cd091
2022-12-01 13:36:54 -05:00
Aidan MacDonald
5b1dd64f50 settings: Add helper function for handling filename settings
The old inline implementation was buggy -- it didn't check the
suffix was actually at the end of the string before stripping
it, and didn't check for truncation. This version also avoids
using an extra buffer.

Change-Id: I33abfefc508675d3079cc64a9ad2b11d646baa0d
2022-12-01 13:07:24 -05:00
Aidan MacDonald
afa58ef277 settings: Remove unused INT_SETTING_W_CFGVALS
This hasn't been used for quite some time; it appears to have been
obsoleted by table settings.

Change-Id: I8818e3f639d9783aaa2554dd098128ceda686527
2022-12-01 13:07:24 -05:00
William Wilgus
c9c340704f playlist_create fix race condition
I'm pretty sure this is a very old bug I traced it down to the
current_playlist getting changed out from under add_indices_to_playlist
causing myriad of issues from buffer full to invalid control file to shifting indices

this only appears to happen with the dircache on

I still get an incorrect resume state with the wrong song very rarely -- turns out get_filename seeks the file FIXED

Some debugging left in for now till we can verify there are no other instances

Change-Id: I289a775462eddfe93da4a326dc9e38605af06816
2022-11-30 23:15:49 -05:00
William Wilgus
0ba3392b9f Bug Fix bookmark.c fix resume_info overwritten
fix a bug where when 'most recent bookmarks'
was enabled the next bookmark file written
would get the info from the last 'most recent'
bookmark instead of the current bookmark

also removed the global resume_info struct in favor of local variables

added verification of the resumed track

Change-Id: I10176a2e4a18da6d5c4bb5fc0ed5d7e81d803ed5
2022-11-30 00:01:47 -05:00
William Wilgus
3f4e55a872 bookmark.c fix bookmark.c fix filename generator #2
strlcpy returns the size of the string it tried to create so we still need strlen

since we know what the sizes are of the strings just check for overflow first and use strmemccpy

fix bufsz on playlist_get_name()

Change-Id: Iaa52f869994ca94487c19b0cf2958330db4fc786
2022-11-27 02:05:34 -05:00
William Wilgus
b11777b06c bookmark.c fix off by one error in filename generator
strlcpy expects the buffer size so the name gets truncated by one character

Change-Id: I05ca0fed0a65a8b200f75b9647f7bf11407777a6
2022-11-26 20:51:33 -05:00
Christian Soffke
4ecf3970a6 Playlist Catalogue: Return to opened playlists
The playlist catalogue now remembers when you left
a playlist open and will return to it automatically.

Change-Id: I5b725a776b0a524139588c86e38150e5e25cb7d7
2022-11-26 17:20:06 +01:00
Christian Soffke
098a8fd334 Playlist Catalogue: Restore selection in playlist
Saves and restores the selected item in your
most-recently accessed playlist, similar to Database
and File Browser.

Change-Id: I00afca41e33470cb458c4b87baccd6fd4016887a
2022-11-26 17:20:06 +01:00
William Wilgus
88ecaf2b8c bookmark.c remove static bookmark buffer
Change-Id: Ie23760890e76177acf3700fb8eb73ca7f81f112e
2022-11-25 23:39:47 -05:00
William Wilgus
853d70e938 Fix Red confirm_delete, CHECKWPS & DBTOOL
Change-Id: I2f375def92e4c3c4b6be9d0494de682e6d3ebd2d
2022-11-24 23:44:35 -05:00
William Wilgus
71934d4c16 move confirm delete prompt to misc.c
Change-Id: Iadb1c7199caa5070f555eb4d329efb02e3193289
2022-11-24 23:09:26 -05:00
William Wilgus
3a22322ab7 bookmark.c parse_bookmark remove redundant conditional
we can just use the buffer not being NULL to decide

Change-Id: I233191ce16db4c18ed418794c18b8c51bb05399d
2022-11-24 23:30:37 -04:00
William Wilgus
780990fe5d bookmark.c remove some global buffers
refactor to allow removing some of the static buffers

Change-Id: Ia3ff6ea28f35634fd8c31b023431ad53bd542085
2022-11-24 22:00:14 -05:00
William Wilgus
8b522b8973 bookmark.c clean-up
No functional changes

Change-Id: If82f3e58ca848ade2a49f31357d39de9c5ba9ece
2022-11-24 20:08:00 -05:00
William Wilgus
1e6d643cfb Fix Red lib/helper.h
missing brightness defines

Change-Id: I7f6d67e2eb1be9c156a02ad3ff1ba4141e7cd08c
2022-11-23 23:55:45 -05:00
William Wilgus
97a82ee3ec plugins HAVE_BACKLIGHT helper remove ifdefs in favor of dummy functions
lessen the ifdef hell

Change-Id: I52f830284e4599f3fc3a75c27dda27058b8de1a3
2022-11-23 23:00:29 -05:00
William Wilgus
3745c813f9 misc.c open_pathfmt caller supplied buffer
Amachronic raised concern about open() blocking causing a static buf
to get overwritten in multiple calls its prudent to just have the caller
supply the buffer to minimize stack issues later

Change-Id: Iae27c7d063adb1a65688f920f6aa5c395fa5694a
2022-11-23 22:09:46 -05:00
William Wilgus
80b8b13544 BUG FIX settings_list fix un-macro'd int_settings for backlight & contrast
missed these

Change-Id: Ifdc682cc36a9192c8e0bbd2e2fee1f32946362e7
2022-11-23 21:14:09 -05:00
William Wilgus
8379c6eb07 tagtree remove unneeded strlen
unfortunately most of the overhead in searching for <Untagged> occurs in
reading of entries so changing searching the resulting string faster doesn't
do much good but any we don't need this strlen call since its already been
computed

Change-Id: Ia2815a6e7d75237366977632f9b0bc7999254096
2022-11-23 11:01:19 -05:00
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
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
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
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
5d7e15324b Fix tree scrolling not showing end of text
Fixes FS#13243

Change-Id: Icc9fa1e92ca5c928f90ba1a8291bdf37a6fe7898
2022-10-30 14:11:20 -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
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
Aidan MacDonald
b677da6595 shortcuts: Increase max shortcut name to 64 bytes
32 bytes is a little small, and it's also good to have extra
space to accommodate non-English languages.

Change-Id: Iced38fd5140e219b16dcfa6d30cc4191266926bd
2022-10-27 10:49:58 +01:00
Christian Soffke
193ebb5a36 Enable access to Shortcuts Menu from QuickScreen
Offers a quick way of switching to the Shortcuts Menu
by pressing the 'context menu' button while QuickScreen
is active (e.g. long press Select on iPods and some other
players)

Change-Id: I38292c7070cf093a81e1db688809b1f0d6a8764a
2022-10-25 03:26:51 +02: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
Christian Soffke
653082ad1d Database: Adjust "Play Selected First"&"Shuffle" behavior
- With "Play Selected First" and "Shuffle" enabled,
another item was randomly selected when returning
to the list. This appears to be a bug

- With "Play Selected First" disabled, the first item was
selected. This appeared to be intentional, since, at least with
"Shuffle" disabled, that is the item that was played
back. This may not be helpful either, since it makes you lose
your place in what can be a long list. It is also  not
consistent with the behavior of the File Browser. The current
selection should probably be maintained in all cases.

- At least according to the manual and the behavior of the File
Browser, "Play Selected First" should only apply when "Shuffle"
is enabled.

Change-Id: Ic1205477d5bf8b22f8f32dd6d31d3b9ceb5a2d24
2022-10-21 03:59:49 +02:00
Aidan MacDonald
e27a6bad4f skin engine: Remove redundant argument from do_non_text_tags()
The skin viewport is already passed in info->skin_vp.

Change-Id: I5369684ba2a743d7bd804b33845bdb6ac17c46d0
2022-10-18 12:56:28 +01:00
Aidan MacDonald
015101bb2c Remove prototype for nonexistent sb_skin_data_load()
Change-Id: If4551cd10850c10ce091792da8770e0886aa20b9
2022-10-18 12:56:28 +01:00
Aidan MacDonald
14fbefdf39 Move skin global state to the WPS
This state is actually specific to the WPS and it makes more
sense to put it there.

Change-Id: I5dfee237fdcbae944806501ff3127a930820d68a
2022-10-18 12:56:28 +01:00
Aidan MacDonald
13da1ba785 Remove is_fading from the global WPS state
Turns out it was never assigned and always false.

Change-Id: I8cd9118682e7a0785c262d4c0594f8f51412c18b
2022-10-18 12:56:28 +01:00
Aidan MacDonald
33a47e4a49 Remove ff_rewind from global WPS state
Turns out it's local to ffwd_rewind() in the WPS.

Change-Id: Iaa6e69185db67b8aad61f1d2ad29c98f15f37370
2022-10-18 12:56:28 +01:00
Aidan MacDonald
6e4c866756 Remove unused 'may_fade' argument of pause/unpause_action
Change-Id: I4eedcf30fa704521e751732a56775c43e9a8bd99
2022-10-18 12:56:28 +01:00
Aidan MacDonald
e03bc66594 Correct typo DEFAULT_SKIP_TRESH -> DEFAULT_SKIP_THRESH
Change-Id: If8f7d11301a07a7f63adfac618f07cfed9516eef
2022-10-18 12:56:28 +01:00
Aidan MacDonald
46c3d1e030 Cleanup unused cruft in wps.h
Change-Id: I4278bea7342a859b18b72a9a4b1918b403842bb8
2022-10-18 12:56:28 +01:00
Christian Soffke
0761532d09 Don't autoload bookmarks after saving dynamic playlist
4f83e66 (FS#13287) introduced a useful option to
immediately re-load the saved dynamic playlist, so that
bookmark creation becomes possible.
(Current Playlist->Reload After Saving)

It seems unnecessary and won't produce the intended
effect to autoload bookmarks after the playlist is saved,
since playback position will be restored to where
it was previously.

Additionally, with "Load last Bookmark" set to "Ask",
the dialog  for choosing a stored bookmark will appear
after the playlist has been saved. The dialog is
unwanted, since:

- Selecting a bookmark doesn't have expected effect
- Selecting "Don't resume" will actually resume
- Cancelling out of the screen will prevent the
saved playlist from being loaded, without this being
obvious to the user
- It causes a crash if the dynamic playlist is saved
from within the Playlist Viewer (both the Playlist Viewer
and the bookmark selection screen use the plugin
buffer)

Change-Id: I7d696e56c89394b3cd10ef6acfed4ddc7e814118
2022-10-18 07:23:25 -04:00
Aidan MacDonald
55185277ba Fix red for Android builds (c6ee9dc883)
Change-Id: I416fbd24bd2dd91738cb8664b8f3f4877905336d
2022-10-17 15:20:28 +01:00
Aidan MacDonald
f805b492d5 Fix red for !HAVE_ALBUMART targets (c6ee9dc883)
Change-Id: Icdd6e051e5f9b31b287d53d9480f445df884d9d1
2022-10-17 15:20:19 +01:00
Aidan MacDonald
c6ee9dc883 Limit exposure of skin engine internals
Drop wps_internals.h from skin_engine.h. The WPS and to a lesser
extent the radio screen are too tightly integrated to drop their
dependency on wps_internals.h, unfortunately. Skinned lists, for
obvious reasons, also need access to the internals.

Change-Id: I00a55aa423900f9ad22edccbe2fc1910af380e38
2022-10-17 14:29:12 +01:00
William Wilgus
56d4227897 yesno_res gui_syncyesno_run fix scroll run-on bug
the GUI_EVENT_NEED_UI_UPDATE event was not canceled till
after the call to scroll_stop this resulted in the scrolled line
being re-added after the function was done causing a crash

thanks spork, amachronic

Change-Id: I2e484a2b877f6da63171eb997f62a21e95ca9bfc
2022-10-16 13:02:12 -04:00
Aidan MacDonald
1718cf5f8a Convert a number of allocations to use buflib pinning
Several places in the codebase implemented an ad-hoc form of pinning;
they can be converted to use buflib pinning instead.

Change-Id: I4450be007e80f6c9cc9f56c2929fa4b9b85ebff3
2022-10-16 14:50:39 +01:00
William Wilgus
b16bae6fe6 skin_display.c cleanup - No functional changes
Change-Id: Ib8ce47d9cf33ba6b02d799862f322e481a712dfb
2022-10-16 04:30:22 -04:00
William Wilgus
ffdc64bea2 skin_engine fix invalid buflib handle checks
buflib considers handles <= 0 as invalid
skin engine was using handles < 0

Change-Id: Ie156223a43039d48ef4846fe31e6191630fa7c04
2022-10-15 11:17:52 -04:00
William Wilgus
f3d679aefe skin_engine fix free pointer crash
skin_engine uses -1 to signify a free handle 0 causes crash

Change-Id: I1db8743c14dd244fe92973e31bac61efdd12ca7f
2022-10-15 10:56:30 -04: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
Solomon Peachy
9d3d925295 Revert "RFC: Get rid of mpegplayer plugin"
This reverts commit d25d24812e.

Change-Id: I1563223e343fb1e2eda72a45823b38350025ff93
2022-10-13 11:08:11 -04:00
Solomon Peachy
418169aff8 Revert "Remove YUV blitting functions and LCD modes"
This reverts commit fe6aa21e9e.

Change-Id: I8bb1e5d6c52ed1478002d2140ef494ec5d62b8e3
2022-10-13 11:08:06 -04:00
William Wilgus
f9ea1fc79d splash_progress add delay function
I figure this is a better way to allow a delay before showing the
progress meter

Change-Id: I909902a52619023b0b87635d2eb94ed00cb4bcec
2022-10-13 00:10:25 -04:00
Solomon Peachy
5c6d6bd612 keyremap: Use '%z' when printing size_t
Change-Id: Ie752c8b8e35b98e52ed8999e92d5c65181109240
2022-10-10 08:24:33 -04:00
Christian Soffke
eb5e15803b Use splash_progress in database when inserting into dynamic playlist
Change-Id: Iaef66cc00a1be0ce3cf869f0e6137a2e9efa2713
2022-10-10 07:49:04 -04:00
William Wilgus
0374dea33a playlist_resume add delay before progress splash
Change-Id: I2927ddc49c3dbe96746237c8577f26f240182eeb
2022-10-10 07:20:07 -04:00
William Wilgus
70d5b2cd45 splash_progress fix red for non-color targets
Change-Id: I6a50264a8edb2745c3d5ecd3cd558c0e83e4a529
2022-10-09 11:00:40 -04:00
William Wilgus
d73aaf3d9e add splash_progress
the loading track splash flashes and is ugly
add a function to display a progressbar along with the splash message

spruce up database commit message as well

Change-Id: I2749b958c1ee5dad2631a5f999a4b00ddca7f225
2022-10-09 08:46:51 -04:00
Aidan MacDonald
e57b4f9099 gui: Remove gui_synclist_item_is_onscreen()
Only the "Rockbox Info" screen uses it for a rather silly purpose,
so remove the function. This helps to decouple things from the GUI.

Change-Id: Icf73e3ee1230c75bf43016c0f1c05c7fe1a24895
2022-10-05 11:23:11 -04:00
Aidan MacDonald
1c5a0497cf gui: Remove list "limit_scroll" member
Get rid of the "limit_scroll" member from lists and make it a
local variable of gui_synclist_do_button().

Bump plugin API version since struct gui_synclist was changed.

Change-Id: Ie3244a85e5a1022a2f6e238a506fdbba67724962
2022-10-05 11:23:01 -04:00
Aidan MacDonald
d5a081cbd1 gui: Remove "enum list_wrap" from list action functions
Removing the "list_wrap" argument is actually pretty easy.
In practice, almost all lists are using LIST_WRAP_UNLESS_HELD
behavior so we can make that the default. A couple of lists
disable wraparound with LIST_WRAP_OFF; this is now achieved
by setting the list "wraparound" flag to false when setting
up the list. LIST_WRAP_ON was unused and is of questionable
value, so it has been removed entirely.

This makes list wraparound behavior a property of the list,
controlled solely by the "wraparound" flag. The result is a
simpler list API and implementation, without changing the
behavior of any lists.

Change-Id: Ib55d17519e6d92fc95ae17b84ab0aaf4233bcb5a
2022-10-05 11:22:55 -04:00
Aidan MacDonald
ff378deb69 gui: Remove gui_synclist_limit_scroll()
Since gui_synclist_do_button() overrides the setting at runtime
there is no reason to have a public API call to set it. Really
it should be a local variable, but it will be simpler to do that
after refactoring how list wraparound behavior is handled.

Change-Id: Id09d42197814102693752a9f64db8325118ca796
2022-10-05 11:22:34 -04:00
Aidan MacDonald
ead172c05d gui: Remove redundant copies of list scrolling settings
gui_list_screen_scroll_step() and gui_list_screen_scroll_out_of_view()
just copy the global setting into a local static variable.
Since they don't do anything special when the setting changes
it's simpler to use the global setting directly.

Change-Id: Ib6a7bf4e09b6dabbc1597cf28ddbafc0bc857526
2022-10-05 10:22:55 -04:00
Aidan MacDonald
fe6aa21e9e Remove YUV blitting functions and LCD modes
None of this is needed now that mpegplayer is gone.

Change-Id: I360366db8513e4d988021e8d7b7d8eb09930efb8
2022-10-03 13:30:01 +01:00
Solomon Peachy
d25d24812e RFC: Get rid of mpegplayer plugin
It might have made sense once upon a time, but in today's world...

Change-Id: I5d638e6f7a2308c50ab12bd901338f02cf426aae
2022-10-02 11:57:20 -04:00
Aidan MacDonald
9ce5b2a2ed gui: Remove show/hide selection option in lists
The implementation of the "show_selection_marker" option in
lists isn't great. It's a cosmetic option used to hide the
selection, but it causes the list to do funny things to the
selected_item and doesn't play nice with voiced menus, since
these rely on the selection to determine what item is spoken.

There are only two user-facing lists that use the option, the
"Rockbox Info" screen and a menu in the superdom plugin. The
rest are debug screens, and cosmetics don't matter much there.

Given how little used the option is, and its issues, removing
it seems reasonable.

Change-Id: I2c70b3e4c74ff3cc6dbac46366a371d271dd2d58
2022-10-02 09:21:25 -04:00
Aidan MacDonald
c1d75a6bcb Fix yellow from 5b0506e9de
Change-Id: I6391a6f13e64fad5c54dd29d8d696a08d45362dc
2022-10-02 13:57:52 +01:00
Aidan MacDonald
5b0506e9de gui: Constify list title text
Use const char* pointers for list titles. Only one debug menu
actually modifies the title, and in that case it's legal to
cast away const because the title points to a known mutable
buffer on the stack.

Change-Id: Idb8ab307b9a6ec23a93d8420c5e19fafd9f59c30
2022-10-02 08:20:10 -04:00
Aidan MacDonald
420fb1163c skin engine: Fix bug with %Vs(color) tag
The %Vs(color) tag doesn't set the text style properly and causes
the background to not be cleared when rendering lines. For static
text this is rarely a problem, but for scrolling text it'll cause
the text to "smear" once it starts scrolling.

Fix this by setting STYLE_DEFAULT, so the background gets redrawn
when the line scrolls.

Bug report: https://forums.rockbox.org/index.php/topic,54320.0.html

Change-Id: I835c806005ea40fd6bac3692e52a9c325581a293
2022-10-01 12:58:00 +01:00
Aidan MacDonald
f373c97c90 Define LCD_STRIDEFORMAT unconditionally
Instead of putting "#ifdef LCD_STRIDEFORMAT" at every usage of the
macro it's simpler to have config.h define LCD_STRIDEFORMAT to the
default of horizontal stride when the target leaves it unspecified.

Change-Id: Ib187012aad65ac678dbd837b1464a83bad722411
2022-09-30 10:42:49 +01:00
Solomon Peachy
24daa26598 FS13356: Update Polish Translation (Adam Rak)
Change-Id: I6ee55f2a6024411515670fc1249268b66aad09bd
2022-09-25 18:28:04 -04:00
Solomon Peachy
36ea69b27e FS#13365: Updated Italian translation (Alessio Lenzi)
Change-Id: Idbb6d58667a153d0381252da64383423d383471f
2022-09-25 16:15:30 -04:00
Aidan MacDonald
e4aec7d648 key remap: simplify and use movable allocations
Have action.c control the key remap buflib allocation so that it can
be made movable. With memory management offloaded, core_keymap.c only
needs to deal with loading keymap files. Simplify the code there and
use buflib pinning so the file can be loaded directly into the buffer.

Change-Id: Ia654cc05ce6b286f96c1031fa4f7d4b3859a2c1a
2022-09-25 11:05:59 +01:00
James D. Smith
6beebd75e7 Cabbie v2: 240x320: Increase font size to 18. Remove linespace and increase the size of the album art slightly to better utilize the screen area.
Change-Id: Id20097006c9f82e1bb8a758c4edd94dc278c669f
2022-09-18 11:09:38 -06:00
Christian Soffke
3f3b738e06 Partial fix for FS#12702: playlist catalogue silently fails to save files
Change-Id: I13130f6b257b38e7a0d8ae22accd182330ff4e9f
2022-08-21 09:36:04 -04:00
Benjamin Brown
a6e9ecb086 Updated keymaps for Sansa Connect
* added scroll wheel to doom
   * added scroll wheel to brickmania
   * changed spacerocks to use scroll wheel instead of buttons

Change-Id: I9d6ff0b4c5deea147178f5cd9f96ae435e7b5cd8
2022-08-19 00:31:00 -04:00
Christian Soffke
c1c0318c8d Playlist Viewer: Fix unintentional fallthrough
Change-Id: Iead5635e0e7f20dc556f26f735fd47597c9169b6
2022-08-19 00:29:17 -04:00
Christian Soffke
5e757b4d6e Playlists: Fix losing cached control data when resuming
Shuffle and Unshuffle commands are not flushed to
disk when control data is updated. The same applies
to Delete and Reset commands, unless HAVE_DIRCACHE
is undefined (see update_control() function in playlist.c)

playlist_resume() discards cached control data.

This resulted in a bug where (e.g.) removed tracks
from the current playlist would reappear if you stopped
and resumed playing immediately afterwards (instead of
restarting in between).

Change-Id: I273f61e823a1d99426a18079b81aa07915620f30
2022-08-19 00:28:35 -04:00
Christian Soffke
8f6d0efd71 tagtree: Delay showing search progress when ramcache is enabled
The disk doesn't need to spin up when the
database is in RAM. Results are usually returned
without any noticeable delay, so the splash  only
creates distraction.

Change-Id: I04e5b7d2e00f045143dd86e0561091be3d8f9724
2022-08-19 00:27:34 -04:00
Christian Soffke
cf37676fb1 pictureflow: fix FS#13360 softlock cannot be disabled
Change-Id: Id34cc737f9d43a5cbaf5519a6f05ca31efbee8f2
2022-08-16 13:19:11 +02:00
Christian Soffke
7a3d829543 pictureflow: fix stack overflow
I noticed a stack overflow on the Fiio M3K when launching
PictureFlow from the Playlist Viewer after opening a playlist
from the file browser using the context menu's "View" option.

Change-Id: Id87fb59e36518bd7ceb61f886d5759fc3206aadf
2022-08-16 13:18:43 +02:00
Solomon Peachy
d4917888e3 Fix yellow introduced in cef9fa22ef
(Wrap new function in HAVE_HOTKEY)

Change-Id: Idf5f96bd1e097fc580a6b1ba5be4b93a78de9deb
2022-08-05 14:05:33 -04:00
Christian Soffke
cef9fa22ef playlist viewer: enable hotkey
'File Browser' hotkeys can now be used while
browsing a playlist.

The manual has been updated to reflect this and
to say that the File Browser hotkey works in
the context of the database as well (existing
behavior)

Change-Id: I51b23e82e0fb00772efdb8784db966d454fb2560
2022-08-05 11:39:35 -04:00
Christian Soffke
3edf3ba18d add hotkeys for properties and pictureflow
Change-Id: I16b36dd02f1c2aa186d957c64ed7d239c4c91047
2022-08-05 11:39:35 -04:00
Christian Soffke
7727486423 playlist viewer: add menu option to show songs in pictureflow
(The playlist viewer has to be re-initialized
after returning from PictureFlow, since they
both use the plugin buffer)

Change-Id: Ib3ef0acec65c88363830c59c8c73e9cdf8b528f0
2022-08-05 11:39:35 -04:00
Christian Soffke
f0a05e0993 Properties plugin: Fix crash when parameter is zero-length string
This seems to be what is provided by the database when length
of path+file name of an entry is larger than MAX_PATH.

Change-Id: Iaf40ce945732a8a8c2e5270a80886dcb537a72be
2022-08-04 14:40:59 -04:00
Solomon Peachy
840fb4d47b doom: Fix a potential buffer trashing in the doom plugin
(caught by GCC12's -Waddress)

Change-Id: I122b44324c60c668ed4a066aa6301d40cb7597ba
2022-07-11 19:35:10 -04:00
Solomon Peachy
632af4837e xworld: Fix a really old bug that effectively disabled fast movement
(Thank GCC12's -Waddress for catching this)

Change-Id: I5153938ee490fe7976a3c81ea13d87abce2b9eba
2022-07-11 19:32:34 -04:00
Solomon Peachy
05149cd4dc Fix a couple of warnings uncovered by GCC12
Change-Id: Ib628a27bfc6f95a822e46b931ccfbed90f41b122
2022-07-11 16:11:29 -04:00
William Wilgus
c3e75a1ce7 Reset settings on button hold fix lang for non supported ipods
Change-Id: I7ab15c26d7670472b0861e2862e865b63064c939
2022-06-21 23:49:44 -04:00
William Wilgus
8283752223 Reset settings on button hold
extend this properly to the gigabeast and iriver
updated manual entries

Change-Id: Ibd1bce8d113193cb3b76f4daf0d6ceb01a2f7585
2022-06-21 22:43:39 -04:00
William Wilgus
e75e07e1b6 plugin sliding puzzle fix unneeded check
Change-Id: Iab345d2ec490311fc8a5482c52dbed14f5e11070
2022-06-21 22:22:50 -04:00
Aidan MacDonald
7e0492444c usb: remove "Ask" USB Mode (FS#13317)
USB ask mode is basically a footgun: it can't work on native targets
and doesn't work reliably on hosted ones, and it continually produces
a slow trickle of problems. FS#13317 gives a rundown of the issues.
Removing the setting seems like the best solution for now, since a fix
would be pretty involved.

This partially reverts 60f581e8f5. The USB Mode setting is left in
place so the option can be added back later in a non-buggy way.

Change-Id: Ie01b28dd2ed95a31b509a7834d85bac8eb866098
2022-06-21 18:11:53 -04:00
William Wilgus
6cdd142d5c Setting reset fix red
Change-Id: I9174d7695b117fa10d10cda8ff9cccc50ebeb7f2
2022-06-20 20:16:55 -04:00
William Wilgus
ed37c2e894 FS#13193 - Add option to disable settings reset on startup
Updated version of the patch originally by user cockroach

UNTESTED
Ipods?, Iriver H10,
I do not own these players so YMMV

https://www.rockbox.org/tracker/task/13193

Change-Id: I7924837f582cc5c49ee68c186d6822f577f65147
2022-06-20 18:57:25 -04:00
Solomon Peachy
58bf7c7e6f Update english-us "translation"
Change-Id: I5b59e75d6c5ba06a3917fa7046bb769d873d6bfd
2022-06-13 09:16:34 -04:00
Solomon Peachy
7d5aeeecf1 FS13343: Updated Serbian translation (Ivan Pesic)
Change-Id: Ic4ba206b981dd03e7dcdd5a1fd3bc5f48ecc3584
2022-06-12 17:12:44 -04:00
Solomon Peachy
6a707cd913 FS13346: Updated Slovak translation (Matej Golian)
Change-Id: Icb2e7084c60fe091ea00928d84fe036b4341b762
2022-06-12 17:12:07 -04:00
Solomon Peachy
595a34640b FS13345: Updated Polish Translation (Adam Rak)
Change-Id: I9292f2dfcdbc65e9020ff2f1ef4569a371f780bc
2022-06-12 17:10:54 -04:00
William Wilgus
1d39261338 lastfm_scrobbler Add settings WIP
add settings to the scrobbler plugin
Start Playback -- resume playback at plugin start
  (while enabled if nothing to resume will bring you back to scrobbler menu)
Save Threshold 0-100% -- when this much time has passed the track will be
  saved and marked (L)istened

Verbose -- Supress messages such as 'Scrobbler Started' and 'Scrobbler Flushed'

run the plugin a second time to bring up the menu
if you have resume playback enabled and there is nothing to resume
it brings you back to the scrobbler menu as well

Change-Id: I48d96ea3dc8f37d76a723136004af149429e0b2e
2022-05-28 06:23:37 -04:00
Aidan MacDonald
7345666d9c plugins: use menu for lastfm scrobbler TSR exit callback
Use standard menus and yes/no screen for the TSR exit callback,
similar to the recently added test_usb plugin. This removes the
need to define key bindings and it provides a more consistent
user experience.

It also allows the "flush cache" message to be popped up in the
main thread - doing it from the worker thread is unreliable and
the message often disappeared because the main thread did a UI
update immediately after leaving the plugin.

One issue is that quitting the plugin by selecting the scrobbler
plugin itself immediately restarts the scrobbler. This is because
there is currently no way for TSR plugins to terminate themselves
either through the exit_tsr callback or otherwise.

Change-Id: I9690239d5bd58ad2fbb36fd15a10683757aff0ff
2022-05-28 06:23:08 -04:00
Christian Soffke
cade488b08 pictureflow: Fix 'Update Cache' function and update manual
The artwork cache was previously always rebuilt,
even if you had selected the option to update.

"Preparing artwork" should be much quicker now
after a database update.

Change-Id: Ie81486e29d596b52afd21b01ba54c73f1b402be2
2022-05-22 06:55:58 -04:00
Christian Soffke
b357585852 pictureflow: Fix slide_index bound
Parameters for fbound were in the wrong order
and slide_frame wasn't assigned the bounded value

Change-Id: I9b466e8b45e4318cadf59298f8c1145fa4d30ede
2022-05-22 06:55:58 -04:00
Christian Soffke
5146c3043f pictureflow: Fix concurrency issues building art cache
Guards against possible image corruption

Change-Id: Id7e1e3a09cb13c255eea0ffdd2e4c4d558086997
2022-05-22 06:55:58 -04:00
Aidan MacDonald
c116db6065 plugins: add USB TSR test plugin
This is intended for testing USB event delivery to TSR plugins.
Usage:

1. enter plugin -> select Start
2. plug and unplug USB
3. reenter plugin -> select Status
   it should display "State: disconnected" then "Prev: connected"
4. when done -> select Stop Plugin

Change-Id: I6c70f452db642f3fcbfbcb4f06c57f93e60f4cfd
2022-05-21 14:58:55 +01:00
Aidan MacDonald
2f71571c0a Fix faulty Play Shuffled behavior (FS#13347)
When replacing a dynamic playlist with Play Shuffled, the current
track could incorrectly be left at the end of the new playlist.
Fix this - the current track should always be at the beginning,
so it can be skipped past regardless of the repeat/shuffle mode.

Change-Id: Ia86539bc23ad8ebd714b8dc50b5720671b4ad0a9
2022-05-15 15:23:36 +01:00
Aidan MacDonald
d20071def0 apps: Add "keep current track when replacing playlist" setting
Add a setting that makes Play and Play Shuffled in the playlist
context menu leave the current song (if any) playing when they
replace the playlist. Default to on, since this was the behavior
of the old "Clear List & Play Next" option.

Change-Id: I1340aed5c28bb3244e36d0953b3308ae59681c97
2022-05-14 16:05:46 +01:00
Aidan MacDonald
70087fb9f3 apps: Change playlist context menu behavior, fix FS#13336
Rename the "Clear List & Play" options to simply Play and Play
Shuffled, and change their behavior slightly. Previously they
would leave the current song playing, but now they will start
playing the first song of the new playlist immediately.

Shuffle options are now consistently hidden whenever a single
file is selected.

Fixes FS#13336 -- Play Shuffled is now always displayed where
applicable, regardless of playback state.

Change-Id: Idd454b4f9ab2c98cda3ce0389add747a3273fb42
2022-05-14 16:05:45 +01:00
Christian Soffke
f3358eb20a Properties plugin: Eliminate redundant Track Info code
When opening an audio file from the file
browser or database using the Properties
plugin, it will now use existing code from
the Show Track Info screen for displaying
metadata. The menu option has been
renamed accordingly.

Change-Id: I5a824865b9f980151b91aff3c3c18ec45830a12c
2022-05-09 09:44:23 -04:00