Commit graph

16979 commits

Author SHA1 Message Date
Dana Conrad
3555e84a7a Bugfix: some settings can have spaces in them
90bc769 strips spaces from the settings value, but it
goes to the first space rather than just stripping off
the last one. Break out of the loop when we find the
first non-space character.

Also change 0 to '\0' for readability.

Change-Id: I915b82a6d1603740998a67c575d08005456ffbd8
2022-12-08 15:38:12 -05:00
Christian Soffke
66a411a1ba Tree / Playlist Viewer / Menu: Fix redraw issues
1) Tree_lists was only initialized when booting the player.

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

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

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

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

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

Change-Id: I2884249eda55f782e97abad9dc19b3d9d1267fc9
2022-12-08 00:38:59 -05:00
Solomon Peachy
a9a284c1a0 lang: Correct a "mistranslation" in english-us
Introduced in 9a8ec7e0d from March 2021

Change-Id: Ica0767531bfd09d57cda2093d0e2764234b79526
2022-12-07 13:17:56 -05:00
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