This fixes the case where you switch from a file with an artist to one
with no artist, which would show the old artist.
The album field is already hidden, title shows the filename if missing,
and the track info screen is fully reset, so this covers everything
currently present.
Queue now has a separate 'ready' property to indicate it's ready to be used, which is independent from whether it's still loading tracks in. This also improves the response time for shuffling all tracks (we will initially pick a random track in the first 100 tracks whilst the rest of the tracks are loading). This should also fix issues where one song will start playing and then repeat itself when the queue finishes loading, and hopefully solve #160 as well (though I couldn't actually repro this myself).
Co-authored-by: jacqueline <me@jacqueline.id.au>
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/170
Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org>
Co-authored-by: ailurux <ailuruxx@gmail.com>
Co-committed-by: ailurux <ailuruxx@gmail.com>
We still mostly use the singular 'Artist' tag for e.g. displaying a nice
name in the now playing screen, but where a track has an 'ARTISTS=' tag,
we'll split by semicolon and then use the resulting list to populate an
index of tracks by artist
Trying and failing to parse tags from unsupported files is probably
costly (requires reading from SD card), and it probably slows down
indexing large collections that include a lot of non-audio files (like
cover art, etc).
This limits tag parsing to only files that have extensions for
supported audio formats. It assumes that folks don't have audio files
in supported formats with crazy extensions (e.g. an mp3-formatted file
with the extension .lol). Since this hardcodes a list of supported file
extensions for tag parsing, it'll need to be maintained later if more
formats are supported. The file ext matching is case-insensitive.
Fixes#149
I was confused about why setting the level to something lower didn't
seem to work, so this attempts make it more clear that not all log
levels are actually available on release builds.
Fixes#155
I think this is what most folks would expect to happen if BT is
disconnected/disabled and the headphones are removed.
Also, I think(?) this fixes one situation where the device doesn't idle/
sleep when folks would expect it to (not connected to headphones or bt).
This replaces the previous system of a separate track and queue repeat, with a RepeatMode type with the following options and behaviours:
- OFF: No repeat, queue or track. When the current queue finishes, shuffled or otherwise, playback will stop.
- REPEAT_TRACK: The current track will loop indefinitely, unless next is explicitly called through some user action (ie using the next button in the now playing screen)
- REPEAT_QUEUE: The entire queue will repeat indefinitely. When shuffled is enabled this will repeat the queue with new combinations each cycle.
The repeat mode is persisted in non-volatile storage, so the behaviour will be consistent throughout restarts and queue replacements, and so the "queue repeat by default" use case can be met in this way.
In addition, I've made it work a little nicer when the queue runs out in the now playing screen, keeping the previously played track shown and playback can be continued by using the play button or by going to a previous song in the queue.
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/126
Co-authored-by: ailurux <ailuruxx@gmail.com>
Co-committed-by: ailurux <ailuruxx@gmail.com>