Commit graph

142 commits

Author SHA1 Message Date
William Wilgus
97a82ee3ec plugins HAVE_BACKLIGHT helper remove ifdefs in favor of dummy functions
lessen the ifdef hell

Change-Id: I52f830284e4599f3fc3a75c27dda27058b8de1a3
2022-11-23 23:00:29 -05:00
Christian Soffke
17cae50497 PictureFlow: Add hotkeys for changing sorting on iPods / Update manual
Adjust current sorting by pressing both
the Select button and Menu (or Play)
at the same time.

Change-Id: I474b79a16e278d34e3983384125015bdfb6f484a
2022-11-23 01:24:59 -05:00
Christian Soffke
498988d34a PictureFlow: Minor fixes & changed defaults
- Fix FPS counter overlapping
the artist string when
"Show album title" was set to
"Show album and artist at the top"

- Fix disappearance of center album
if certain Settings menus had been
accessed while list of tracks was
showing and you then returned to the
list of albums

- Fix disappearing album artwork after
cache had been created until you started
scrolling

- Enable context menu even if WPS
integration is disabled

- Make splash screen appear only
on first launch and for database
updates, when it is actually on screen
for long enough

- Eliminate 'Loading' splash if tagcache
is in RAM

- Show both album and artist by default on
displays whose height > 100px

Change-Id: Ie70c0d9093789294d288a4f88338ee4a588bf4a5
2022-10-22 09:33:50 +02: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
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
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
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
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
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
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
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
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
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
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
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
Solomon Peachy
9597d7256d Fix lingering yellow from 8325b59f3b
Change-Id: I83b7fbd88b2f47c9bd31943bdc9c4cc8f2d24f4e
2021-12-02 19:52:04 -05:00
Solomon Peachy
0f12a77d60 Fix red from 8325b59f3b
Change-Id: I38f53d1cee1572ef5d82ed07bc184403fa2f7b00
2021-12-02 18:09:48 -05:00
Christian Soffke
8325b59f3b PictureFlow: (grayscale) invert ‘Added to Playlist’ message
Feels less interruptive this way, since the background doesn't
suddenly switch from dark to light.

Also moved message to separate function and added missing
lcd_update() after clearing display.

Change-Id: Id196554b42fa4de16a6b23136d27358159b746b6
2021-12-02 17:37:49 -05:00
Christian Soffke
2ee4f50fa6 PictureFlow: whitespace fixes
Change-Id: I53c75c99110c2eeceed52854bc2ca0ec63770a0c
2021-12-02 17:37:49 -05:00
Christian Soffke
0da0390b85 PictureFlow: Warn Before Erasing Playlist
Respect system-wide setting, in
consistence with browser behavior

Change-Id: I7df90554a466ed5ca1b99da179cc7d95360499b6
2021-12-02 17:37:15 -05:00
Christian Soffke
fd50baa23f PictureFlow: Reversible and interruptible animations
Makes PF usable on older devices with few FPS,
and makes it quicker to navigate on current devices.

- PF_BACK while zooming in to zoom out again
- PF_SELECT or PF_PREV/PF_NEXT while zooming in to skip animation

- PF_BACK while zooming out to skip animation
- PF_PREV/PF_NEXT while zooming out to skip animation + scroll
- PF_SELECT while zooming out to zoom in again
- PF_CONTEXT while zooming out to skip animation and append

- PF_CONTEXT while scrolling to append
- PF_SELECT while scrolling to zoom in

Change-Id: I8d041b53f5990181059fe837a8ca121ebf37a676
2021-11-27 09:02:17 -05:00
Christian Soffke
5bd9ed801f Fix: PictureFlow splash() crash on grayscale targets
On targets where the grayscale framework is used, splash()
won't work (and may crash) if the overlay is not
switched off first. This is not reproducible in the simulator.

Change-Id: Ia22087c4978c8fa247d6d4c64c4b600e4393eebf
2021-11-22 08:06:44 -05:00
Christian Soffke
f9ce8720c4 Fix: PictureFlow crashes
- After appending albums, when memory had been borrowed
from the buflib buffer by shifting memory up using  buflib_buffer_out()
in create_track_index(), memory was later not shifted down using
buflib_buffer_in() (the latter was only called after displaying the track list).

- The picture loading thread was able to allocate memory from the
buflib pool while the main thread was moving the buffer around.
Slide loading will now be paused before shifting operations, and
continued afterwards.

Change-Id: I1c92b6c931fd14ebb885be4bc275148039b76a9a
2021-11-22 08:06:44 -05:00
James Smith
990c543ebc Revert "Pictureflow: Update for tag_virt_canonicalartist."
This reverts commit 60125f6bc9.

Reason for revert: See g#3947.

Change-Id: I34bae3cf5a87a5c99b9a4e5755e1a4a69961b28a
2021-11-21 12:44:57 -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
Christian Soffke
a7d09f8104 PictureFlow: remember inspected album artwork
Each time PictureFlow was launched, it would rebuild the
album artwork cache from the beginning.

Depending on the number of albums, this could take a while
and resulted in choppy scrolling.

PictureFlow will now remember how many albums have been
inspected already, and only rescan and write new artwork
when the album index cache gets updated or rebuilt.

Change-Id: Icd78106dacea44b80904ac609caa355cc9113168
2021-11-10 15:43:57 -05:00
James D. Smith
60125f6bc9 Pictureflow: Update for tag_virt_canonicalartist.
Change-Id: Ie9fc906b6f863347174b383b01514961b307c4f1
2021-09-17 21:42:05 -04:00
William Wilgus
aad15d5cd7 code cleanup encase ;; in brackets {;;}
Change-Id: I253e19695709b4184ceb4a0748300f7c68437c1c
2021-08-13 11:51:21 +00:00
Aidan MacDonald
5cbeb88541 FiiO M3K: keymap improvements & fixes
- Add support for skip and seek while the player is locked.
  (Thanks to @bahus for the suggestion)
- Fix touch zones because the down button zone ended up being
  a lot smaller than expected due to the touchpad's wonkiness.
  Also added a visual display of the touchpad to its debug menu.
- Fixes the pictureflow keymap because it was mostly unusable.

Change-Id: Ic0da4f8df3613ff7828ce1cb940ed9e77ada3281
2021-05-22 12:20:44 +00:00
Solomon Peachy
7d0d32dbc6 Nuke the never-functional iriver ifp-7xx port
It never worked, and hasn't compiled in something like a decade, Given
the HW capabilities (limited onboard flash, no expandability) there's
really no point in trying to fix/complete it.

Change-Id: I7d175089840396f8891645bd10010d730dd5bfdc
2021-04-26 07:42:58 -04:00
Solomon Peachy
3ba2f6e5c7 Nuke all TCC77x targets: iAudio 7, Sansa C100, M200(v1-3), Logik DAX
They were never finished, never saw any release ever, and haven't
compiled for the better part of a decade.  Given their HW capabilities [1],
they are not worth trying to fix.

[1] 1-2MB RAM, ~256MB onboard flash, no expandability

Change-Id: I7b2a5806d687114c22156bb0458d4a10a9734190
2021-04-26 07:41:51 -04:00
Aidan MacDonald
afe80742a5 Fix Pictureflow bugs
It turns out that aa_cache.buf, used to store decoded album art during
background scanning, was not correctly allocated and overlapped with
memory allocated for buflib. This was what caused all the segfaults.

Also fixed a logic error in read_pfraw(), which returns a buflib handle
on success, but also returned 0 on failure -- since 0 is a valid buflib
handle, it should return -1 on failure instead.

Change-Id: Ifaa1c02ec19b0859e43c40c0462ed7738d07fec3
2021-04-17 13:06:29 +00:00
Solomon Peachy
d121aa3fe8 build: We don't need sh-specific flags in the pictureflow build.
Change-Id: I1e9ab4332cbeb5aabc01edf825eace6152347e0a
2021-03-25 12:20:15 -04:00