Commit graph

4762 commits

Author SHA1 Message Date
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
William Wilgus
ea738e03d0 Printcell.c fix list item scrolling behavior
make every item in a selection scroll when no columns are selected
otherwise title & currently selected column will be the only scrolling lines

Change-Id: I3bab480f47997b89a01563a69dc68e6633152cf5
2022-01-05 10:43:55 -05:00
Christian Soffke
122ce0089a PictureFlow: Don't insert tracks if track list not available
Change-Id: Ic6d5083bfe7daf3a8639b1405b8be9dae73eb30c
2022-01-04 18:06:42 -05:00
Christian Soffke
de8ee6c9e9 PictureFlow: Switch between albums from track view
Prev/next buttons on iPods or Fiio M3k can now
be used to select another album without having to
return to the albums view first. Scroll wheel/strip
handles scrolling up and down in the track list
as before.

Other targets probably have the necessary
buttons for this, so the keymap can be extended
in the future (same goes for alphabetic browsing)

Also prevents queue overflow and handles
failure case for track list tagcache retrieval.

Change-Id: Ic8ff4471e1583d1ab1f7d16911b15705a7f60aca
2022-01-04 18:04:53 -05:00
Christian Soffke
d183959676 PictureFlow: Show track list loading message
When tagcache or storage are busy, it can
take a few seconds for the list to appear.
Meanwhile,  the screen used to be either blank
or the cover was  left suspended in mid-animation,
if the animation was skipped.

Change-Id: I655320c4f92ff496834e252cc77ece47723a8677
2022-01-04 18:04:02 -05:00
Christian Soffke
dded97be34 PictureFlow: Fix buffer overflow
create_track_index appears to have relied on
buflib_buffer_out returning a certain amount
of space without checking that it was actually
available. In at least one test case, as little as
16 bytes were returned, leading to a buffer
overflow and later a segfault.

Change-Id: Ic0783f3cd5bf015803b7ce90537ba38ab3434bea
2022-01-04 18:02:12 -05:00
Christian Soffke
e3b8b7fa80 PictureFlow: Utilize "Current Playlist" menu (+ GS fixes)
When appending tracks, they were always inserted last.
You can now choose from the usual options offered by
the "Current Playlst" context menu to queue or to insert
tracks at the requested position.
The splash after appending that forced you to wait for
2s has been eliminated.

Also fixes crashes on targets that use the grey_core lib
if a splash showed up when playback was started,
e.g. LANG_PLAYLIST_CONTROL_ACCESS_ERROR, or
when PictureFlow quit.

Change-Id: I661c59057b5315ba793ee1674f7a2ea1ffd7968d
2022-01-04 18:00:49 -05:00
William Wilgus
bfe3dac3ba printcell_helper.c bugfix scrollbar spacing
when the scrollbar was on left and number of items was < nb_lines
the spacing between title and items was off by sb_width

selected item no longer draws separators when no colums are selected

Change-Id: If564261759721eb7bcf3b7b4ba58bf9c130771b0
2022-01-04 16:51:24 -05:00
William Wilgus
a7703e4926 gui lists add callback for owner drawn items
allow the guts of gui_sync_list to be used with owner drawn items

WIP

printcell_helper--

goal: allow data to be displayed in a spreadsheet format  with an easy to use interface

printcell_set_columns(gui_synclist, title, icon)
 sets title and calculates cell widths
 each column is identified by '$' character
 ex 3 columns title = "Col1$Col2$Col3"
also accepts $*WIDTH$
 ex 3 columns varying width title = "$*64$Col1$*128$Col2$Col3
printcell_enable(gui_synclist, enable)
 sets the printcell function enabled

After setting the columns and enabling the printcell function
 items can be added to the list like normal
 column items are supplied delimited by '$'
 ex item = "Item1$item2$item3"
 they will be placed in cells defined by set_columns and scroll if the cell is too small

--Fixed for 1 bit & 2 bit displays

Change-Id: I49bd7903005d7a54e93af4379b0cdea63c860656
2022-01-01 23:56:51 -05:00
Christian Soffke
edc68b0657 Solitaire: Fix Quit option with no saved games
Selecting "Quit" would start the game
instead of quitting if no games had
previously been saved.

Change-Id: I4874288cc1087697dfb593a371e25da473870c8e
2022-01-01 22:01:30 -05:00
Christian Soffke
abfee36ce0 PictureFlow: enable theme in settings menus
Submenus for adjusting settings
were previously left unthemed

Change-Id: I073c7aabfdd9ce4e4c10c4c0dc689112c29b2a58
2022-01-01 22:00:09 -05:00
Christian Soffke
e8b9123205 Database: show song's album in PictureFlow
Adds a 'PictureFlow' command to database context
menus for quickly bringing up the album for a
song in PictureFlow.

Change-Id: I88cd89e93d9418558c698a15fc7fb5d9a90fb262
2021-12-28 11:06:10 -05:00
Christian Soffke
6c6f0757d7 PictureFlow: Show background cache building progress
There was no easy way to see how far along PictureFlow
was in building the art cache, once background scanning
had commenced.

PF now uses the  screen area normally used by the FPS
meter to show completed percentage until building the
art cache has  finished.

Change-Id: I60fa7187b522cda219e35f5a9f630835ecac6883
2021-12-24 11:08:26 -05:00
Christian Soffke
6b5c811d1c PictureFlow: reset idle timer when art cache is being built
- creating the album index and art cache can take longer
than what the idle poweroff timer is set to, so make sure
to reset it periodically

- when finished, make sure progress is stored
to disk immediately, so it isn't lost on idle poweroff

Change-Id: Ibe88a260e4495b1bd007f37950e8c5fbc9364975
2021-12-24 10:38:37 -05:00
Aidan MacDonald
fc678bd001 battery_bench: Log battery current information
Works on targets supporting CURRENT_MEASURE.

Change-Id: I021b995c46fab923287ad54e72863695ef9ed58a
2021-12-23 11:39:58 +00:00
Christian Soffke
694f929a99 Credits plugin: use black background
Sets the lcd background color to black and foreground color
to white when displaying the 16bit logo, so that it always
blends in with the background regardless of theme colors.

Change-Id: Ia3afde178866b84d194c2dd839dac24f8c6e8d05
2021-12-09 21:01:11 -05:00
Christian Soffke
43d811073a Credits plugin: whitespace fixes
Change-Id: I21689357ad7e0ce86cc31ecfa7a94f1f8b620120
2021-12-08 22:29:35 -05:00
William Wilgus
5433ea5405 random_playlist.lua make index more sparse
The name of the game here is to load the database file without taking over the
audio buffer.

5mb database file will now successfully load

added an option to save playlist directly to disk and bypass the rb builtin function completely
however if you choose play the playlist will be loaded back from the disk into the inram dynamic playlist

Change-Id: I43e76f63379721f36ed082c0ad47a6f2539fb15f
2021-12-08 22:09:16 -05:00
William Wilgus
221e8752cc plugin.h & lua add playlist_insert_playlist
having issues running lua and loading a playlist

Change-Id: I72d32d77e6567ceed7e8e5fd492eebf0ee44561a
2021-12-05 23:10:19 -05:00
William Wilgus
8a8dfa0e52 random_playlist.lua bugfix
removing trackks after create appears to cause crashes
removing the playlist appears to be sufficient to prevent
append to the currently saved random_playlist.m3u8

added yield on screent update, since we have no sleep this could be an issue

Change-Id: If04517f852e329088e30885d964f2407a2ebf318
2021-12-05 15:03:02 -05:00
Christian Soffke
d93a3cac50 Use LIST_WRAP_UNLESS_HELD consistently
LIST_WRAP_ON seems to only be used in 3 places
at this point.

- Keybox Plugin
- Puzzles Plugin
- (File) Properties Plugin

Switch them them over to LIST_WRAP_UNLESS_HELD
as that is used everywhere else and is arguably
preferable (the option to turn off list wrapping
completely remains, of course).

Change-Id: Id8017dcbb123a0568cb6db527a8966b63ba06d47
2021-12-05 14:17:52 -05:00
Christian Soffke
daa3967071 Properties Plugin: Fix track or disc number not appearing
Change-Id: I20e60aefd92a2d9f1a64b6197deb6950144a9781
2021-12-05 14:17:44 -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
2bd0d5738f PictureFlow: Preliminary fix for infinite loop
Supposed to prevent situations where PictureFlow
enters into an infinite loop while unsuccessfully
looking for a slide cache slot.

Technically more of a bandaid than a fix at this point,
since it masks behavior that shouldn't occur in the
first place, but at least it will make the issue essentially
unnoticeable by the user for the time being.

Change-Id: I8a9b30448949dd53f624eae918484b740b4f873e
2021-12-03 23:51:12 -05:00
Christian Soffke
09e1cd489f PictureFlow: Add alphabetic browsing (iPod&fiiom3k)
Offers more efficient navigation when number of albums is large.
Scrolling with the touch wheel or touch strip works as before,
but the prev/next buttons jump between album artists by first
letter now.

- Keymap has only been adjusted for iPod and Fiio M3K at the moment.
- requires separate fix for infinite loop

Change-Id: I68da7304d2c7714a5a1aecdf83e937bc9daae3e1
2021-12-03 23:51:12 -05:00
William Wilgus
7200b738a5 lua random_playlist generator
uses the database to create random playlists of specified size

with the advanced GUI you can..
set the number of songs (up to max playlist buffer)
set the number of tracks before a repeat is allowed
play the tracks when finished

-- fix a parsing bug where first and last entry in database
   were corrupted

-- Incremental loading for very large databases, allows decent speed and lower ram usage

Change-Id: Ia95469b6a04625b621129ec61e5db4b2b00adc5e
2021-12-03 16:56:12 -05:00
Christian Soffke
c94acc771d PictureFlow: Read bitmaps in one go
As suggested by amachronic, this may significantly benefit performance.

Change-Id: I4dcf096278ab8042065cf6dce5ff886cdd27dc3d
2021-12-03 02:58:19 +01:00
Christian Soffke
101d431d79 PictureFlow: Fix playback behavior after appending
- Once items have been appended, the existing playlist can
not be reused when selecting an album for regular
playback, since the playlist will be out of sync with the
album's track list

- Don't re-shuffle playlist after appending items

Change-Id: I3b6035033ad1d59f9916c711f13737bb0987c4f6
2021-12-03 02:58:19 +01:00