Commit graph

4789 commits

Author SHA1 Message Date
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
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
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
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
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
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
William Wilgus
e75e07e1b6 plugin sliding puzzle fix unneeded check
Change-Id: Iab345d2ec490311fc8a5482c52dbed14f5e11070
2022-06-21 22:22:50 -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
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
Aidan MacDonald
4b293285ea pictureflow: fix album index alignment in load_album_index
Change-Id: I7c3c86ffdab62859ce88faeeb84160ea52a4626a
2022-05-07 16:28:27 +01:00
Aidan MacDonald
f661dc596e pictureflow: fix bug in calculation of album art buf size
I intended to check for enough space in buffer but this isn't
really doing it and it is making aa_bufsz slightly too big so
it's a possible buffer overflow.

Restore the old ALIGN_DOWN(..., 4) rounding in case it's important,
if not, then no harm done.

Change-Id: I904f255ac79a77d5328b44667502ceae8308e659
2022-05-07 15:52:26 +01: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
Aidan MacDonald
366f00a3d3 plugins: fix out of bounds read in chopper
GCC complains about this when compiling with UBSan.

Change-Id: I4bd8ff2b47882ab95620dc7750a9a80f823cc2ea
2022-05-02 15:38:48 +01:00
Christian Soffke
e71a441762 ImageViewer: Fix buffer overflow
np_file is a buffer of size MAX_PATH. After
removing only the file name component and
leaving the rest of the path, the
available space may not be sufficient
for appending another file name (possibly of
size MAX_PATH itself) to it.

This can occur after a file of acceptable
length is opened in ImageViewer, and you
then advance to another file whose path
(including the file name) is longer than
MAX_PATH.

Change-Id: Ideadd9451359bd5735bce92fca5d983e61f300e9
2022-04-18 10:58:40 -04:00
Aidan MacDonald
0e8f3669d0 Fix remaining red from 3fcdadce24
Change-Id: I619a637bdf1fb932c3618f1f40aaa1c9e7f98300
2022-04-16 16:06:13 +01:00
Christian Soffke
68ac932585 PictureFlow: Disable 'Album Not Found' splash when stopped
...and go to last album, even if it hadn't
been selected for playback

Change-Id: I44013e930a1feb873f128c2885ecb8ddaf4ae3ff
2022-04-16 10:13:50 -04:00
Christian Soffke
e3bf6f08e3 PictureFlow: Delay LCD Update until center slide is loaded
Eliminates flashing of slide right after launch or
when changing sorting on the M3K using the
volume buttons

Change-Id: Icd317e0b0d5b939269dc8dafd30d0c0f9daa5fd9
2022-04-16 10:13:50 -04:00
Aidan MacDonald
3fcdadce24 plugins: Add multiboot select plugin
This plugin provides a menu for easily editing the root redirect file
on targets that support multiboot. You can select a new root from a
list of Rockbox installations detected on the filesystem or remove all
redirects to boot from the default location.

To avoid searching the whole filesystem, only subdirectories of the
volume roots are checked for valid installations. Only installations
that are compatible with the current player will be displayed.

Change-Id: I7dcbadfd97873b87817870e61d2ae37956d2da00
2022-04-16 14:36:39 +01: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
8dbc0914f6 imageviewer: limit progress bar LCD update rate
The progress callback doesn't rate limit LCD updates, which causes
excessive slowdowns (up to 150x!) on some targets. Limiting updates
to 20fps solves the problem and should boost load speed across the
board, particularly for large images and animated GIFs that may run
the progress callback thousands of times.

Change-Id: Ia48924d4dcb24c1111509329581809be494d0165
2022-04-09 23:15:48 +01: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
William Wilgus
bf3e67204c lastfm_scrobbler check for back to back repeat entries
if you skip a track after the halfway point the scrobbler may double post
with slightly different timestamps but the same track info

take a crc of the non-unique part and check against the previously
written track

Change-Id: I676342c4cd76f632131d9cb6d9f7d2f59df357e6
2022-04-02 08:05:37 -04:00
William Wilgus
43abe2d820 lastfm_scrobbler check pointers for validity
we need to make sure we don't deref NULL pointers

Change-Id: I9c564b681cd20222c3a134680e60a310b2eb846c
2022-04-02 07:42:06 -04:00
Christian Soffke
ca0c3dee0a ImageViewer: M3K keymap allow scrolling up/down
Change-Id: I385354688b1d8f8df4d44e7e177e23bdb6ed3df4
2022-04-01 11:01:52 -04:00
James D. Smith
6e3937e836 lastfm Scrobbler: Substitute album artist for empty artist.
Change-Id: I66dda13ec2cbb592ebe0d269f0c7eff749bc737a
2022-04-01 06:11:42 -04:00
Christian Soffke
df3afcfa3b PictureFlow: Configurable album sorting
Now offers sorting by:

- Album artist, then album name
- Album artist, then album year
- Album year
- Album name

Years are determined by the most recently
released track appearing on an album, if the
value differs between tracks.

On the M3K,  instead of by going into Settings,
volume buttons can also be used for quickly
adjusting the current sorting

Change-Id: I2c50059617114fb418336c466fdd37415473ac7d
2022-03-27 08:51:58 -04:00
Christian Soffke
aec8b36348 PictureFlow: Prevent queue overflow & simplify locking
Change-Id: I41f620a4fdaf155913a944e7caf4c015990a53d4
2022-03-27 08:51:58 -04:00
Christian Soffke
ae121de149 PictureFlow: Write bitmaps in one go
Analogous to an earlier change w.r.t. reading bitmaps

Change-Id: I68e71160b51eb893f18071cc77d9c9a3ef84de0f
2022-03-27 08:51:58 -04:00
William Wilgus
593d9f623d lastfm_scrobbler fix yellow for targets w/o storage callback
Change-Id: I0a3dbcf8c8c0c72efa2506d1998fd24d228ed91d
2022-03-26 11:12:19 -04:00
William Wilgus
f105ad7b23 lastfm_scrobbler fix red for devices w/o storage callback
Change-Id: I2062534b6e2a82171b856cc76efe8b78dbf9b13c
2022-03-26 03:20:49 -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
William Wilgus
19d95d7b56 keyremap add plain text import and export
allows users to edit and view keymaps in a text editor
(parser requires one entry per line (LF or CRLF work as line endings)

allow naming of files on save

Change-Id: Id6627171eb96210b2deeef8d15bab3f8d1e0ab3f
2022-03-06 17:00:27 -05:00
William Wilgus
bba0564ec1 keyremap plugin use yes_no prompts, bugfix
use the supplied yes_no dialogs for file delete, key reset, save prompt

return to root menu automatically after loading a file

fix bug where deleting the last file in the list exited the menu

Change-Id: Ib98f6b200b9dee3e4350ad4d7ef80bbb95c77481
2022-02-24 00:26:40 -05:00
William Wilgus
295ec3790d Core Keyremap Allow setting keymap from plugin
Allow setting and removing keyremap on the fly

It was pretty annoying trying to work out a keyremap with a restart
required to set the remap and was quite annoying when I was no
longer able to navigate to the plugin or filebrowser due to setting
the wrong remap

now you can try out a keymap and if it doesn't work a restart will
sort things out

Change-Id: I848fb3bd759f9684ac2497324a371f92b7464f7b
2022-02-23 21:38:27 -05:00
William Wilgus
f7bb9e2167 Add custom action mapping to core
results of an idea I discussed in IRC

changed the way the lookup in the remap file works..

 entries consist of 3 int [action, button, prebtn]
 context look up table is at the beginning
 action_code contains the (context | CONTEXT_REMAPPED)
 button_code contains the index of the first remapped action for the matched context
 [0] CORE_CONTEXT_REMAP(ctx1) offset1=(3), count=(1)
 [1] CORE_CONTEXT_REMAP(ctx2, offset2=(5), count=(1)
 [2] sentinel, 0, 0
 [3] act0, btn, 0
 [4] sentinel 0, 0
 [5] act1, btn, 0
 [6] sentinel, 0, 0

 Note:
 last entry of each group is always the sentinel [CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE]
 contexts must match exactly -- re-mapped contexts run before the built in w/ fall through contexts
 ie. you can't remap std_context and expect it to match std_context actions from the WPS context.

-- Done --

Code for reading core remap entries

-- Done --

import of core remap entires from disk
-- Done --

plugin to set new key mapping (the hard part)

The plugin is started and FULLY functional
you can add actions and contexts
you can change context, action, button, prebtn
delete keymap files
load keymapfiles
save user keymaps
test keymaps before applying them
loading keymaps to core still requires restart
-----------------------------------------------------------------------------------------------

Change-Id: Ib8b88c5ae91af4d540e1829de5db32669cd68203
2022-02-23 08:47:12 -05:00
Christian Soffke
fb91184c4f PictureFlow: Fix broken (iPod) keymap
I must have only tested de8ee6c9e9 using my
custom iPod keymap. Re-mapping the "Left"
and "Right" buttons in this context badly breaks
existing behavior in Pictureflow when using
Rockbox's default iPod keymap.

Change-Id: I2aff6297d7e229a056383afe6074c41829b38e2d
2022-01-30 16:36:07 -05:00
Christian Soffke
8f063d49c2 ImageViewer: Fix FS#13329 (GIF File handle/memory leaks)
Change-Id: Ib3ef22716c8ba35c7bb78231ca4f5c7155f16018
2022-01-09 14:36:14 +00:00
Christian Soffke
f379e1dbb3 ImageViewer: Fix GIF Decoder progress bar
Change-Id: I9db9b27f9e12f08323534038bc6f0882329a2c00
2022-01-09 14:36:14 +00:00
Christian Soffke
18358ed541 ImageViewer: Fix gifs sporadically crashing on targets
ensure 32bit alignment

Change-Id: I11e0df599403a888fa63dab8f1c5a94a5f35d9ad
2022-01-09 14:36:14 +00:00
Christian Soffke
fbdcfca085 ImageViewer: Improve smoothness of animated gif playback
Don't disable grayscale overlay, don't show "resize" messages
between frames and  and don't clear display unless actually
necessary

Change-Id: I9f501d8280ce0c8f26f4345088d805d1b84cf143
2022-01-09 14:36:14 +00:00
Christian Soffke
3adeae2026 ImageViewer: Fix crash when zooming on grayscale devices
lcd_update was called while the grayscale overlay was running

regression, apparently introduced by 0ceaff2

(only reproducible on target, not in Simulator)

Change-Id: Ife0ef359e19a03a6dc033070a11ae5843ee555e6
2022-01-09 09:11:29 -05:00
Christian Soffke
131497d786 PictureFlow: Don't sync playlist after every file
Since we manually do it later, syncing after every
file is unnecessary and can make the audio
queue overflow

Change-Id: Ia7ab6ee345b25a453c56f48ed0d330b04da6da94
2022-01-05 18:28:06 +01:00