Commit graph

1108 commits

Author SHA1 Message Date
Chris Chua
86429dbf1e Using ARM Unified Assembler Language
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
2023-03-23 13:28:22 -04: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
William Wilgus
958daa925e [BUGFix] ClipPlus move picker below yellow screen split
Sansa Clip and Clip+ have a split monochrome screen
 some versions have a dead line of pixels
having text split at this line makes it hard to read
move text picker below this split on these devices

Change-Id: I1ebcb4c4c7b1ea950f38e35fed06ed85437a657f
2023-01-13 23:12:28 -05:00
William Wilgus
91c7e333d7 Revert "keyboard.c make editline respect current UI font"
This reverts commit ebebef5566.

Reason for revert: I don't want to get too deep into this till I come back to the keyboard rewrite (hopefully)

Change-Id: Ia273f1a19a042be2dd0f1ee46690c03f2865cd95
2023-01-13 22:46:25 -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
ebebef5566 keyboard.c make editline respect current UI font
Change-Id: I4dc95d42544a10df8086cc58c4a305d45b56bb1b
2023-01-13 01:36:45 -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
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
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
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
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
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
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
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
William Wilgus
09ef94ed8b add const to const * strings iriver Fix Red
the iriver devices overwrite the pointer

Change-Id: I20ae6db2aec0f957824b61db349c7c45a95e58d9
2022-05-03 23:58:00 -04: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
6b8c94a6e3 Fix some non-portable alignment values
UBSan reports an avalanche of unaligned pointer bugs stemming from
hardcoded 4-byte alignments used in certain places. Use sizeof(long)
instead to align to the machine word size.

Change-Id: I28e505212462c5268afa24e95df3a103ac3e2213
2022-05-02 15:38:48 +01:00
William Wilgus
f0d3a62d91 keyboard.c change math for editline above picker
Change-Id: I59e7f7face07f3f97fc6e016ee333cd3139ad5fd
2022-04-27 21:40:49 -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
Aidan MacDonald
5aa0fc3b00 jpeg: provide a rough estimate of decoder memory overhead
JPEG decoding requires additional space in the bitmap buffer beyond
what is needed for the decoded pixel data. Provide a way to estimate
how much overhead is needed.

The actual overhead is sizeof(struct jpeg) + decode_buf_size, where
the latter depends on the image size and JPEG encoding used. From my
testing decode_buf_size is normally pretty small (under 5 KiB) but
looking at the code it could be large in some cases, primarily with
large images, so 32 KiB seems to be a decent compromise. Someone who
knows better about JPEG should pick a better value if that's too big.

Using a constant is obviously not the most accurate but it seems to
be the simplest option for retrofitting to existing code.

Change-Id: I573b0abb8ca2d79e43f185010487f07226edb793
2022-04-09 15:20:57 +01:00
William Wilgus
bd444ebd0a BUGFIX keyboard.c make vp alloc static
don't stop playback to alloc viewports for the keyboard
For the moment it doesn't make much difference
each vp takes about 40 bytes (double that in the sim?)
so not the end of the world 120 extra bytes

Change-Id: I482d7e3061cf9fb8065dc28bf62a6f830770f3c7
2022-04-08 18:11:21 -04:00
William Wilgus
d1be73cfc0 keyboard.c Use viewports, move text box pos
allows items to be moved around with less code changes

remove scrolling I was not overly impressed with it
add test_kbd plugin

Change-Id: Ic183c7221bda9405891632704f3a7bbfd79bfe83
2022-04-07 19:46:56 -04:00
Aidan MacDonald
e8faf2f2ad buflib: add a common dummy callbacks struct & use it
There are various allocations that can't be moved or shrunk.
Provide a global callback struct for this use case instead of
making each caller declare its own dummy struct.

Also fixed ROLO and x1000 installer code which incorrectly
used movable allocations.

Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
2022-02-12 10:24:32 -05:00
Aidan MacDonald
127bb1b6e1 FiiO M3K: remove volume setting on rec. screen
This controls the playback volume, which is not useful for
the M3K because it's impossible to play back and record at
the same time.

Change-Id: I5b0931c22b484f3ff6441d6c88079f18ec70f7f8
2022-01-29 15:13:54 -05:00
Aidan MacDonald
525eb15864 recording: fix mono mode mixdown functions
Rewrite copy_buffer_mono_* functions for correctness.

Bad pointer arithmetic in copy_buffer_mono_l produced
wrong results, or panics on archs which can't handle
the unaligned pointer.

None of the functions handled zero size copies properly
though this probably wasn't an issue in practice.

Change-Id: I81c894e1b8a3440cb409092bec07fe3778a78959
2022-01-17 00:37:12 +00:00
Aidan MacDonald
f68c6c14d9 recscreen: clean up menu building code
Remove the use of constants and ifdefs in favor of a
single enum and build the menu with a counter. This
simplifies the source and optimizes to the same code.

Change-Id: Ib07f0634ac8f663452c3e6e3c3d92fb6da1a1b4c
2022-01-17 00:37:12 +00:00
Aidan MacDonald
acc7d16e3b Fix some hardcoded assumptions in recording.c
There were some hardcoded branches handling left/right gain for line-in
or FM radio inputs. If the target only has a microphone, these bits are
useless and cause compile errors due to missing audiohw settings, etc.
This patch #ifdef's them out.

Change-Id: If6a6918b2fabb256261c84651803bbf44deacb1a
2022-01-17 00:37:12 +00:00
Aidan MacDonald
7e428ad190 touchscreen: force 3x3 mode in the keyboard
In absolute pointing mode the keyboard is virtually unusable since
the keys are too tiny (just 8x6). There are other issues too: for
example putting the keys on top doesn't make sense on touchscreens
and there is a lot of empty space in between keys that serves no
real purpose.

Until these issues can be addressed properly simply force 3x3 mode
when in the keyboard.

Change-Id: I3ea95ae479372f5b5f86ffcc2dbde10a03663820
2021-11-21 20:26:20 +00: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
b56372bbcb Plugin Api add core bitmaps
share all the core icons with plugins
these are all small mono icons like usb plug icon or
play, fast forward, rewind icons

--include the icon_helper function

Change-Id: I385028815a4dd368515f491a9e19dee3d500252d
2021-08-26 12:55:34 +00:00
Ulrich Hecht
c302c157d5 peakmeter: re-enable on hosted platforms
Has been disabled since HW codec support was dropped, but works fine. Tested
on Surfans F20.

Change-Id: I97f06a009048e8135ca21118467c491e7077fa4f
2021-08-19 18:09:48 +00:00
William Wilgus
ee6b737b65 pcm_record.c iAudioM5 FixRed
Share a bit of code in order to free up iRam for the iAudio M5

Change-Id: Ief05d2614a203df17821ed32b04f5c75a53ca08b
2021-08-10 07:56:33 -04:00
William Wilgus
4fb5aeb096 recorder/pcm_record.c cleanup copy function
re: coverity
write_write_order: In long(*s++) + *s++,
s is written in *s++ and written in long(*s++)
but the order in which the side effects take place is undefined because
there is no intervening sequence point.

Change-Id: I2911c240f3e85fcfbf77297e8579e02e217c5af5
2021-08-10 11:22:13 +00:00
Aidan MacDonald
03a6eb63f1 Simplify clamp_component
Surprise surprise: the compiler generates shorter, branch-free code
if we don't try to be clever with signed/unsigned casting tricks.

Change-Id: I93d2020b6127e7d43feee394b06a52aaeddf3b79
2021-08-05 10:26:50 +00:00
Solomon Peachy
7f638e54ee RFC: Fix a couple more dangling stack-allocated viewports
They could end up getting referenced after the stack has been popped.

Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2
2021-07-07 15:19:43 +00:00
William Wilgus
a6eafc86f8 Remove execute bit from file permissions from recent commit
Change-Id: I415cf235d2b179ae8c58b0427308103be3e00130
2021-03-02 02:10:53 +00:00
Michael Giacomelli
64cc9aad73 Do not resize images greater than 32767 pixels in either dimension
Internally, the resizing code uses the rockbox dim structure, which uses signed shorts.

Change-Id: Ic8850e8563a9d8c0cb3cf8269e2576be9e42b45b
2020-12-14 04:14:45 +00:00
Solomon Peachy
804a49886a statusbar: Make statusbar height equal SYSFONT_HEIGHT
And size elements horizaontally based on SYSFONT_WIDTH

Unfortunately we need 16px icons to make 16px statusbar look right
but at least it _works_ properly now.

Also: all targets currently use 8-px SYSFONT, except some hosted bootloaders

Change-Id: I0cdf97e6ef47ec49693ef79667b200595b4fe075
2020-10-26 19:52:40 +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
2127906384 peakmeter: Fix warning on some hosted targets
Change-Id: Ieae0b08a2f747955ad3e392fbff90884dc4265ef
2020-07-24 18:29:04 -04:00
Solomon Peachy
5dbb757670 peakmeter: Fix simulator build breakage introduced in 8cb55546
Change-Id: I86c327cf7053e71df7550b6d0673262035f95978
2020-07-24 17:50:31 -04: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
William Wilgus
cb94b3ae2e keyboard add ability to specify temporary custom layouts
rb core allows you to load custom keyboard layouts

this patch adds the ability to load a keyboard layout in a buffer
the custom layout is temporary and does not overwrite the current layout

use like so:

    unsigned short kbd[64];
    unsigned short *kbd_p = kbd;
    if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
        kbd_p = NULL;

    rb->kbd_input(buf,sizeof(buf), kbd_p);

Change-Id: I7be2bd4a1b4797a147fa70228a9749dc56ac052a
2020-07-22 06:48:28 -04:00
Solomon Peachy
c0ebbd4ccb jpeg: Fix an overflow when decoding images for non-color targets.
(Warning raised by GCC 4.9.4 -Os)

Change-Id: I1d2f491c8bdb11fe89ffb119e248ca0f4eb69de2
2020-04-05 06:34:21 +02:00
William Wilgus
448b97a888 fix recording.c file split time in seconds not minutes
FS#13173

Change-Id: Icae45bf21c3470e04e7d99355a09d016d204d574
2019-08-04 13:38:38 -05:00
William Wilgus
fc7a45853b Fix possible truncation albumart.c
Change-Id: Ie0e576f26c0507cc12fbdc12093d6fe924377e1d
2019-07-09 22:58:06 -05:00
Solomon Peachy
75fe78c802 Handle SYS_POWEROFF event in recorder and chessbox plugins
Credit to Igor Poretsky

Change-Id: I151d3511b9cee269190d87df7fa7dd355aaafc9b
2018-12-23 18:01:54 -05:00