Commit graph

328 commits

Author SHA1 Message Date
Christian Soffke
422ea20cef Warn before overwriting another playlist on disk
When saving a playlist to an existing file on disk,
warn user, unless the playlist's file name remains
unchanged.

Change-Id: I10d82667de5fadb5323be4f981bea9263849f07a
2023-06-21 13:09:05 -04:00
William Wilgus
78c92c5ca8 [Feature] Supress voice during sleep timer shutdown
if show_shutdown_message == false and sleep timer is active
talk will be disabled on shutdown

Change-Id: Ia660e753700f3e283691f41797ef7a77a2d9a8d9
2023-04-08 17:13:07 -04:00
Aidan MacDonald
5b27e2255a Add perceptual volume adjustment
The perceived loudness change of a change in volume depends
on the listening volume: at high volumes a 1 dB increment is
noticeable, but at low volumes a larger increment is needed
to get a comparable change in loudness.

Perceptual volume adjustment accounts for this fact, and
divides the hardware volume range into a number of steps.
Each step changes the dB volume by a variable amount, with
most of the steps concentrated at higher volumes. This
makes it possible to sweep over the entire hardware volume
range quickly, without losing the ability to finely adjust
the volume at normal listening levels.

Use "Volume Adjustment Mode" in the system settings menu
to select perceptual volume mode. The number of steps used
is controlled by "Number of Volume Steps". (Number of steps
has no effect in direct adjustment mode.)

It's still possible to set a specific dB volume level from
the sound settings menu when perceptual volume is enabled,
and perceptual volume does not affect the volume displayed
by themes.

Change-Id: I6f91fd3f7c5e2d323a914e47b5653033e92b4b3b
2023-01-22 21:19:57 +00:00
Aidan MacDonald
15c4447b66 Fix red dc83963962
Change-Id: I196268c6f6bc4f6e2d8f2cb7dcc3a12218c5d9d4
2023-01-22 21:19:34 +00:00
Aidan MacDonald
dc83963962 Add helpers for converting to/from normalized (perceptual) volume
These routines were taken from alsamixer and converted to fixed
point for Rockbox.

Change-Id: I64e8bf08da02b1e6e3ef10fdc78254bf8e87ff20
2023-01-22 15:43:00 -05:00
Aidan MacDonald
67cb2e3cdc Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
2023-01-15 08:57:45 -05:00
Christian Soffke
7f265ee8dd Database: Add ability to insert multiple files into playlists
You could only add single files to playlists
from the database browser before. This
enables adding any database selection to
a new or existing playlist.

Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
2023-01-14 12:14:28 -05:00
Aidan MacDonald
1e9ad3ca0d Remove buflib allocation names, part two
Remove allocation names from the buflib API and fix up all callers.

Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2023-01-13 10:32:54 +00:00
William Wilgus
88f6628423 consolidate bmp_read function between icons and skin_parser
uses fd now rather than opening file twice

Change-Id: If35418cbc77adacf5e96fb6aa0fc8ffef2fffcbd
2022-12-20 19:07:46 -05:00
William Wilgus
1930ca8d66 remove rockboxlogo after boot INIT_ATTR
nets about 5k on clipzip  (less on mono, more on others)
to move rockboxlogo to .initdata section

Remove show_logo completely and move to main.c
remove plugin stub
give credits plugin its own copy
credit fallback is now show_info()

Change-Id: Id9ed787e605ed29e7ab1e7a74d3821cd0f840ed4
2022-12-19 18:59:59 -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
8ff2c81bde Improve transition between plugin and WPS
Eliminate flashing when plugins are launched
from WPS, by not enabling the SBS, and by
deferring other lcd updates.

Also prevents flashing root menu activity when
returning from plugins.

Change-Id: I7d761867027f2275c4ab8e16ada3107c7ba0be6e
2022-12-13 21:10:16 -05: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
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
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
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
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
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
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
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
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
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
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
Aidan MacDonald
6e4c866756 Remove unused 'may_fade' argument of pause/unpause_action
Change-Id: I4eedcf30fa704521e751732a56775c43e9a8bd99
2022-10-18 12:56:28 +01:00
William Wilgus
79864c6ec2 add const to const * strings
I don't think this will amke any difference except maybe for hosted ports

Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-03 23:00:58 -04:00
Aidan MacDonald
d55dceff37 apps: Add ability to do a clean reboot
Allow a clean shutdown to end in either power off or reboot. Add a
new event SYS_REBOOT to signal it and sys_reboot() to trigger the
event. SYS_REBOOT signals a reboot request and should be listened
for alongside SYS_POWEROFF events.

Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2022-04-16 14:36:39 +01: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
William Wilgus
2352cef6d0 replace more strcmp if then trees with string_option()
1

Change-Id: Ic89bbb2ab41068d09c7bd9caa5ba7f38749b9084
2022-03-13 14:31:02 -04:00
William Wilgus
74df3ba2d8 add function string_option to misc.c use in skin_parser.c
function string_option allows a string to be found in a
supplied list of options

Change-Id: If9134090406b74ab11f4ef9ed6517a4b99b9d73e
2022-03-13 03:45:00 -04: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
William Wilgus
3e37013218 misc.c strip_extension() cleanup
optimize +
add some error checking of inputO

Change-Id: I88c476f5fa66847adc0b361df1a0dd4818dbfdc6
2021-08-17 08:28:23 -04:00
William Wilgus
d57900ae12 misc.c format_sound_value guard division by zero
Change-Id: I7085cb34d2258aa5fc7e04fc0e73d6f733810038
2021-08-05 11:00:47 +00:00
William Wilgus
29fa47d43d Open Plugin cache plugin entry when possible
leave plugin entries in ram and try not to save them unless necessary
doesn't use more space just a bit of careful ordering with the buffer

Change-Id: I1973e9ad4655c2544f596b37cee35601a0cffa94
2021-03-18 02:39:30 +00:00
William Wilgus
3237ae4a4f LCD core move buf ptr and address look up function viewport struct
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device

[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr

while remote lcds may compile (and work in the sim) its not been tested on targets

[FIXED] backdrops need work to be screen agnostic

[FIXED] screen statusbar is not being combined into the main viewport correctly yet

[FIXED] screen elements are displayed incorrectly  after switch to void*

[FIXED] core didn't restore proper viewport on splash etc.

[NEEDS TESTING] remote lcd garbled data

[FIXED] osd lib garbled screen on bmp_part

[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport

[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer

[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing

[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage

[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags

Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26 12:28:48 -04:00
Solomon Peachy
a96eb1a7f7 Fix warnings and errors introduced in b030bf5
Change-Id: I23966b6a79c0d2cbab2e01c649c1b991f460d8ad
2020-10-01 16:08:20 -04:00
William Wilgus
2df3a5b04c Headphone / lineout pause/resume #FS13237
Allow Lineout to behave like headphone port in regards to
plug/unplug pause/resume

Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
2020-09-18 00:22:52 +00:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
Sylvain Saubier
1224919f3a Comment details, typos
Change-Id: I71a283b8e705ad8b9274858bc3cde19d25fc7253
2020-05-24 14:31:15 +02:00
Solomon Peachy
2d70fdcd8c Improved reliability of runtime accounting and speaking it.
Change-Id: I6f0fb907e0378487cec387a2cfd3a20b9a596c4e
2019-08-06 04:47:20 +02:00
Solomon Peachy
0a6cad736f FS#12353: For car adapter mode, make delay before resuming configurable
Original patch by Stanislav Chizhik
Udpated by Igor Poretsky & myself

Change-Id: I472d4852ac25885658245f077723e4c98b9ad9b8
2019-02-03 23:36:57 +01:00
Solomon Peachy
39b64f7d4d FS#10311 -- Add beep when navigating to beginning or end of list.
Originally by Stephane Doyon.
Updated by Alex Wallis, Igor Poretsky, and myself.

Change-Id: I996f18043bd3377d5aeaf65f4290250ea2a6832b
2019-01-31 15:25:35 +01:00
Solomon Peachy
d24edc605b Add HAVE_LINEOUT_DETECTION and associated logic
This allows targets to automatically switch audio settings when the
line out is plugged/unplugged.

Only hooked up on the xDuoo X3, but there are other potential users.

Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
2019-01-04 23:52:42 +01:00
William Wilgus
d258edbb4f Fix Auto Ranged Time Fix Red for Database
Change-Id: I8f4edc4ca84792f977ea673d2435e15f7e2da14e
2018-12-22 14:31:40 -06:00
William Wilgus
4a8f263a7d Fix Auto Ranged Time Fix Red for Checkwps
Change-Id: I36e37c7557d6eee07978046e549509ee628aba2e
2018-12-22 13:53:00 -06:00
William Wilgus
a06d9c85f7 Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)
Unifies time formatting in settings_list.c allows time format to
display as HH:MM:SS.MSS or any consecutive combination thereof
(hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss)
works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING'

Time is auto-ranged dependent on value

Adds talk_time_intervals to allow time values to be spoken similar to
display format:  x Hours, x Minutes, x Seconds, x Milliseconds

Table lookups merged or removed from recording, clip meter and lcd timeout
-String_Choice replaced with TABLE_SETTING or INT_SETTING for these
functions as well, cleaned-up cfg_vals that get saved to cfgfile

RTL Languages ARE supported

Negative values ARE supported

Backlight on/off are now Always and Never to share formatter with LCD
Timeout

Added flag to allow ranged units to be locked to a minimum index

Added flag to allow leading zero to be supressed from the largest unit

merged talk_time_unit() and talk_time_intervals()

optimized time_split()

optimized format_time_auto()

Backlight time-out list same as original

Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
2018-12-22 12:27:21 -06:00