Commit graph

535 commits

Author SHA1 Message Date
William Wilgus
c85a4f1fa4 menus remove reserved 'param' parameter
-- missed the plugin menu --

Change-Id: Iac2c9b0b8212ab5f3ac2ef90e1ac2723d212f86c
2022-12-17 04:24:37 -05:00
William Wilgus
ccf1aaa5be menus move functions with parameters to their own type
left the union with function(void) and function_w_param(param)
as a few areas might still need to use both (onplay.c)

there might be a few I missed yet..

Change-Id: I593a6875301923e19ba04ad1b0f3173dc9ebdf1f
2022-12-17 02:51:43 -05:00
William Wilgus
6b87bfadff wps.c cleanup gui_show_wps
remove some old cruft move a few things around clean-up flow

Change-Id: I138c6cd9e2d58ef526eb686333da413819df725d
2022-12-14 22:35:33 -05:00
Christian Soffke
ac9066dd44 Setttings: Eliminate gui_synclist_init_display_settings callbacks
Since synclists are now re-initialized after leaving
Settings menus where the callback was used, it
shouldn't be needed anymore.

gui_synclist_init_display_settings can also be made
local to list.c now.

Change-Id: I674e4da49153440b48298fed7c4d98b421b7beaa
2022-12-11 11:50:33 +01:00
Christian Soffke
dfd9c10589 Eliminate skin updates in between activities
1) Adds way to pop activity without refreshing the skin at
the same time.

Activities are sometimes popped in immediate succession,
or one activity is popped before another one is pushed right
away. This can lead to the UI appearing glitchy, due to an
activity only appearing for a split-second, which is especially
noticeable with complex skins that change the dimensions
of the UI viewport depending on the current activity

To fix this, prevent superfluous skin updates

* when switching between:
- WPS and browser
- WPS and Playlist Catalogue
- WPS and playlist
- WPS and Settings/System/Plugins

* when accessing Track Info or when displaying
bookmarks using the context menu on the WPS

* when switching from QuickScreen to Shortcuts Menu

2) The playlist viewer activity was pushed & popped
redundantly by playlist_view.

----
NB:
Behavior has remained unchanged in all instances of the
code where pop_current_activity() has been replaced by
pop_current_activity(ACTIVITY_REFRESH_NOW).

Change-Id: I56b517b8c9dba823a9fed3a3f558d7469dcea9fd
2022-12-11 11:50:33 +01: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
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
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
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
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
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
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
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
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
Solomon Peachy
05149cd4dc Fix a couple of warnings uncovered by GCC12
Change-Id: Ib628a27bfc6f95a822e46b931ccfbed90f41b122
2022-07-11 16:11:29 -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
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
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
William Wilgus
002575dbcf [BUGFIX] gui_synclist move global display settings to list struct
forgot to add the update function to the list_wraparound callback

Change-Id: I7ee7940f126726c727344d7d09371f1bf3295c81
2022-04-18 23:08:04 -04:00
Christian Soffke
1c66e97522 Database: Remove File View menu
These options don't seem to
apply to the database...

Change-Id: I777073eeaed4099acf44996b95fa05b4c2b3abc4
2022-04-18 10:48:41 -04:00
Aidan MacDonald
1af92e5ff8 Fix red from 6f5af8e53c
Change-Id: I02dbc3e91856eaef081446ca77919e6182a85e1d
2022-04-17 17:21:02 +01:00
William Wilgus
ddcab156f7 gui_synclist move global display settings to list struct
its really painful needing to override global settings in order to change
some aspects of lists

this patch moves:

[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]

to variables within the synclist, it also makes updating
after settings changes a necessity

I think I have the static synclists in core covered

(I think the one in gui/list-skinned can be left as is)

this patch allows easy modification these flags on the fly

Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
2022-04-10 22:24:28 -04:00
William Wilgus
43830d0128 alarm_menu share setter with settime
share the time picker with the alarm

block the date portion, seconds are ignored

Change-Id: Idc6974466772c33248ff532c8f3c62c744ee06d9
2022-03-30 09:05:28 -04:00
William Wilgus
fd15ea25d3 LastFm remove scrobbler from core make a TSR plugin WIP
remove scrobbler from core make it a plugin

Change-Id: I606810eba7d570dfb332789aed913c6f8adc7fb7
2022-03-26 02:50:11 -04:00
Wolfram Sang
95dfc489b5 sync clock with RDS time
Tested with my SansaClip+. I don't think this will need extra battery
but let me know if I am wrong.

Change-Id: I287dae134113e0f8a138af68f5087b8ea45b0f4c
2022-02-07 22:04:10 +01:00
Christian Soffke
bc5a638594 Option to switch off album art or to prefer file over embedded
Large embedded album art can cause pauses during
playback or when skipping between tracks, especially
on older devices, but embedded art is currently loaded
even when separately stored smaller image files would be
available.

A workaround is to remove large album art from the
metadata of files.

This now adds a setting to either turn off loading of
album art completely, or to prefer loading the album art
from a separate image file and thus ignore the embedded
versions.

Change-Id: I22fb581abf56072e35e6c29d72e553747ec1a96a
2022-01-22 08:29:40 -05:00
Aidan MacDonald
dcac2c616f Add setting for numeric list sort order
The sort order of numeric lists can now be changed with the
new "List Order" setting. It defaults to ascending for most
scrollwheel targets and descending for all others, matching
the old hardcoded behavior.

Change-Id: I4866f04ec5995158edf9e40badf7f661b3ddea81
2021-12-11 01:13:22 +00:00
Christian Soffke
7e0e4fe888 Add setting to hide shutdown message
Also keeps display from lighting up before shutdown,
which reduces distractions, especially at night and
when the sleep timer is used by allowing the
screen to remain dark.

Change-Id: I1c2d1966f6fb9766532adf01e8828876a871857f
2021-12-08 22:26:38 -05:00
Aidan MacDonald
e3ee1908dd powermgmt: Small cleanups to battery capacity code
- Don't include the 'battery capacity' setting unless the
  target allows changing it.
- Clean up the preprocessor conditionals used to check for
  variable battery capacity support.
- Don't use a variable for battery capacity unless it is
  actually needed.

Change-Id: I3d8a338f107014f2c5098bc0a44ef0cfb4df9356
2021-12-05 13:37:25 -05:00
Christian Soffke
fbf83dc4ce Add setting for disabling wrap-around lists
Allows user to decide whether scrolling lists will wrap around
to the opposite end after the first or last item has been reached.

Change-Id: I22156812cf4c857ddc4b6c48c1cef013b1985260
2021-11-11 17:31:10 -05:00
William Wilgus
30a23fdd6d folder_select.c move to plugin as db_folder_select
handles the folder selection for autoresume paths and database paths

folder_select uses the pluginbuf to build the directory tree
hopefully having it as a plugin will make it stop corrupting
TSR plugins like battery_bench and announce_status

I left the original include and source in the gui directory for now
there are currently no other users..

Change-Id: If40ccb5a2bec4286a0616c10dfa7e1479a592808
2021-11-11 00:28:59 -05:00
Moshe Piekarski
13ac485625 Add single playback mode
(FS#482)

Change-Id: I8b4c3e4ffb6975122153e82f2b9848c382195163
2021-11-05 09:20:04 -04:00
William Wilgus
d72a0ed65d Use USB events for storing plugin_menu state
use usb connected callback to cancel menu reentry after USB plug/unplug

Change-Id: I8267deed6e8ada94ca527392f56f50ef22def1d7
2021-10-31 12:42:24 -04:00
William Wilgus
dc24a18cef PLUGINBROWSER make resumable
make the plugin browser remember the last item between invocations

this has bugged me for the longest time dealing with the plugin_menu

Fix a very old bug fix for reloading lang strings in the lang menu
FS#8117, sending multiple ENTER_MENU_ITEM callbacks from different
areas of the code makes it hard to keep track of where your callback
is originating

Change-Id: Ib0a61558c11ee4c772134378a7020ac0e10fc4ee
2021-10-29 03:07:42 -04:00
Aidan MacDonald
6322e66219 Remove long-deprecated old style EQ settings
These were deprecated by 1eb17dc9f4 back in 2013 just prior to the
3.13 release. We've had 3.14 and 3.15 since then and I guess nobody
will complain if we finally remove them (fingers crossed...)

Also fix a line which got missed when converting hardcoded numbers
to EQ_NUM_BANDS in that commit.

Change-Id: I79dd71f1f2810bf19bc135999868fafc5fee6e04
2021-08-28 13:23:34 +00:00
Aidan MacDonald
30e96a3732 quickscreen: fix EQ enable not working in quickscreen
The EQ enabled setting needs to call into the DSP core when it's
changed but this was only hooked into the EQ menu. The quickscreen
uses option_select_next_val() so those DSP hooks were not getting
called because the setting did not have any callback defined.

It seems this bug was introduced by 362f7a3220 removing the blanket
call to settings_apply(). Other settings might be affected too.

Change-Id: Idcce5809c525fa619e6bdf1be50c98a5df103fec
2021-08-26 19:34:18 +00:00
Aidan MacDonald
2008b7d1b0 Fix yellow from d541a72a
Change-Id: I9c539035544d285da1941d2c1954cf2aa4d00087
2021-08-06 19:59:33 +01:00
Aidan MacDonald
d541a72a0e Bugfixes in eq_menu.c
Change-Id: Ibf754554f685d13ac00a49694fcecee459ff838f
2021-08-06 18:23:57 +00:00
Solomon Peachy
68294da574 Document an intentional fallthrough in the volume limit menu code
Change-Id: I51d331ff788b73aa84fece63bfdca9c3e08c0384
2021-07-22 23:55:03 +00:00
Dana Conrad
14f7a958af Softlock Improvements
Add a check to see if the keys are currently locked and allow
them to be unlocked to ensure we don't get stuck when the current
playlist ends while the WPS is locked.
(Original by Aidan MacDonald)

Adding initialization for unlock_combo and to arm the autolock
(if enabled) without the user needing to press the lock button
at least once every boot (which is the prior behavior).

Removing screen_has_lock check from is_keys_locked()

Change-Id: I0fbf9b9746b011a7086ec8505a7ecc4b84f2d332
2021-06-04 00:00:57 +00:00
Dana Conrad
4f83e66cd4 FS#13287 - Load a newly saved playlist and resume where it was
Works from any playlist saving operation accessed from the
While Playing Screen, all other playlist saving operations
are unchanged.

Now a user-selectable setting! Located in
General Settings -> Playlists -> Current Playlist ->
Reload After Saving (Yes/No)

Change-Id: I5085c3f4c56c518a812d5ee015d15cc4dca19a28
2021-05-03 20:10:27 +00:00
Aidan MacDonald
f6d3680cb8 Make sure battery menu is shown if it contains settings
The #if statement didn't reflect all menu items in the battery
menu, so if the USB charging enable setting was the only one
present, the entire menu would be hidden.

Change-Id: I17a4ed626debf1f61ca140d67d477bdbd52ca180
2021-04-21 18:28:09 +00:00
Solomon Peachy
bc416ff590 misc: Only include rbpaths.h and string-extra.h in places that need it
(Don't include rbpaths.h in settings.h, or string-extra.h in rbpaths.h)

Build-tested on rocker, erosq, mini2g, nano2g,
                xduoox3, clipzip, dx50, and uisim

Change-Id: If32e9c9910f5c8247a655cb64522b84d6d7ccbb5
2021-04-10 12:08:12 -04:00
Solomon Peachy
213d372c92 FS#13272: Fix up volume_limit to respect decimilaztion.
Change-Id: Ib0e5ddcd660115f156ddb545e45bbe7da42f9709
2021-04-07 14:38:54 -04:00
Dana Conrad
1aed109fa8 Add ability to always have autolock on
Tested on ErosQ

Added a setting in the Advanced Softlock menu to always
have autolock on, rather than having to "arm" it with the
softlock button. Lock/Unlock still works the same with
this on, but when the screen turns off, the device always
ends up in the locked state. Requires Autolock On to be
set as well, and the normal Autolock functionality is
unchanged with this off.

Caveat: the power/softlock button must be pressed
at least once after powering on the device or enabling the
feature. After that, it should consistently always "arm"
the autolock.

Added feature to manual in
manual/configure_rockbox/system_options.tex. Also updated
some labels I had changed in the Advanced Key Lock menu
and added information for Disable All Lock Notifications
in a previous commit. Shared items also updated in
manual/configure_rockbox/display_options.tex for selective
backlight.

Change-Id: I09dc6814bee803e40c7088157e1fe9d01d5f3474
2021-04-05 11:09:32 +00:00
Dana Conrad
1c54c5227b Add disable setting for all softlock notifications
Tested on erosq

Added ability to disable all softlock notifications. Setting is
"Disable All Lock Notifications" under Advanced Key Lock
Settings.

Tested to make sure it doesn't interfere with backlight
exemptions, keylock exemptions, or first press enables backlight
only. When enabled, this overrules the existing Disable Notify
setting, which only disables the reminders when a button is
pressed while the device is already locked.

Also changed phrases in the Advanced Key Lock settings menu
to make it more obvious what the options do. Changed
LANG_ACTION_PLAY, LANG_ACTION_SEEK, and LANG_ACTION_SKIP from
"[button]" to "Exempt [button]". These language changes will
also affect the Backlight Exemptions list, but the wording
should be appropriate there as well.

Added LANG_SOFTLOCK_DISABLE_ALL_NOTIFY and LANG_ACTION_VOLUME,
changed LANG_VOLUME to LANG_ACTION_VOLUME in display_menu.c
for consistency.

Change-Id: I914fe154ba5d508a842165aea7c7755e4e6b9c57
2021-03-23 02:05:20 +00:00
Aidan MacDonald
bf9fdb13c4 Remove some HAVE_FUNCTIONAL_MODE bits
This was dead code introduced by 0662793c, and got missed
by 08ab3aea which should've removed it.

Change-Id: I87d02eab11479133c66524e58efc504ff093dfbd
2021-03-22 13:22:13 +00:00
Aidan MacDonald
55805e13a4 Add new audiohw capability: POWER_MODE_CAP
This allows the user to make use of the DAC's power-saving abilities.
The two modes are "high performance" and "battery saver". This feature
is supported by the AK4376 DAC in the upcoming FiiO M3K port.

The setting is only a manual toggle right now, but in the future it
could be hooked up to the battery level (via another setting) so it
can be toggled automatically when the battery gets too low.

Change-Id: I482af6e2f969fcbdeb3411bd3ff91f866b12d027
2021-03-22 13:00:11 +00:00