Commit graph

36869 commits

Author SHA1 Message Date
William Wilgus
92e77ddbd8 [FIX_RED] microtar.c #2
Change-Id: I22fe42de595c2d31c8720c5bae115e69849f6e28
2023-11-19 13:20:35 -05:00
William Wilgus
58707b0429 [FIX_RED] strcmp missing on microtar.c ??
Change-Id: I55110433dac770896155061ad4572252a6f3a374
2023-11-19 13:03:25 -05:00
William Wilgus
263fc8b98f [FIX RED] include stdio for snprintf
Change-Id: Ib07c2487c84576bcc62a26fed2fba9cfcb1e9c36
2023-11-19 12:35:09 -05:00
William Wilgus
dbe20d453d Extend path_append_ex to truncate compname, remove some strmemdupa
remove some duplicated strings previously allocd off the stack

just removing string duplications that are easily handled with truncation
now available with path_append_ex()

this also has an advantage of less stack used in worst case scenarios

Change-Id: I3a43e33ef8a8c36599e4c6c036a0ccdd8ed0c883
2023-11-19 12:00:02 -05:00
Christian Soffke
a7d0ff2000 Playlist Viewer: Reload indices after saving currently playing playlist
First index may have changed

Change-Id: If6c2fbb42014610aeae48918168c32ca82fb9b5b
2023-11-19 01:13:49 +01:00
Christian Soffke
35f9a5b415 Skin Engine: Fix loading images with same file name
Looks like this was a regression introduced in 01cbb79.
The duplicate img uses an existing buflib handle for
the data, but still didn't have access to the dimensions
from the bitmap struct.

Test case: DancePuffDuo theme for Sansa E200. Only one
dancepuff was displayed. Thank you to goatikins for
reporting the issue.

Change-Id: I32c3ebd1f00738f7db52e7a66f98c4ab3489ee4a
2023-11-18 10:29:47 -05:00
Christian Soffke
5114827937 Fix: Rotate indices after saving playlist w/ first_index > 0
When saving the current playlist, entries written out
to disk were rotated, but its indices were not, resulting
in first_index being out of sync between the two. Thus,
an incorrect index was used for any playlist commands,
from the moment you saved the playlist until the next
time you resumed, which didn't produce the right playlist.

Change-Id: Ie4b02ce9e07e565b1b15c938cc4b820db08e8f1f
2023-11-15 23:49:53 +01:00
Christian Soffke
bd93f9f96f Increase playlist control file's version number
This should have probably been included in e9b4275,
since a control file generated with that build will
potentially cause issues when used with older versions,
in case -8 appears as an insert position.

Change-Id: I4a7097a2bd33c0dbbdad481a341b49be505f34f7
2023-11-12 02:49:20 +01:00
Christian Soffke
a82b30735d Fix queued track when resuming after PLAYLIST_COMMAND_CLEAR
PLAYLIST_COMMAND_CLEAR needs to save the index of the
currently playing track, or a track with index 0 will
be left queued after resuming from control commands

Change-Id: If7449bff92acd556b03c46e82301e8fec5c997d7
2023-11-11 00:36:14 +01:00
Christian Soffke
ba14aecd5e Fix INSERT_LAST_SHUFFLED when playlist's first_index > 0
Tracks were inserted into the middle of the playlist

Change-Id: I2a665fd3e0fe9d8900d6555e6affc5cb3d7513f8
2023-11-11 00:36:14 +01:00
Christian Soffke
8a6aaaa5ed Playlist Viewer: Make Shuffle behave like Reshuffle
Moves currently playing track to the front of
the playlist when shuffling.

Also fixes issues with an incorrect resume index
after repeatedly applying shuffle.

Change-Id: Ieff76e47318a07ee5004b063ded439f2af4bae2f
2023-11-11 00:36:14 +01:00
Christian Soffke
d4f1247aec Playlists: Fix moving songs in reshuffled playlist
The current index wasn't always correct after moving
in a playlist with first index > 0

Change-Id: Ifbcc1e00ed0ec5b26e2176d7971cc5c1e15a8840
2023-11-11 00:36:14 +01:00
Christian Soffke
e9b4275d1f Playlists: Fix resuming from control commands with first_index > 0
add_track_to_playlist_unlocked only increased a playlist's
first index as necessary when its position parameter was
negative (i.e. one of the special insert positions was
specified).

A negative value was not stored in the control file, but
was always converted into an absolute position. Thus, any
adjustments to first_index weren't repeated when resuming
from the control file.

In particular, shuffled playlists were affected (in case of
first_index > 0), when inserting at positions <= first_index,
including appending a track to the end of a playlist. This
works by inserting at first_index and increasing first_index
by 1 afterwards.

Similarly, adding tracks in a shuffled fashion could increase
first index, whenever that was the value randomly calculated
for a track position, effectively appending it (I assume this
is on purpose).

To make sure that first_index adjustments are recovered when
resuming from the control file, and to be able to differentiate
between a prepended or appended track, store the special value
PLAYLIST_INSERT_LAST_ROTATED as the insert position in the
control file whenever first_index would have been used before,
and a special position (other than PLAYLIST_PREPEND) was
provided to the function.

Change-Id: I31f26796627fb136daeddd046cb1892bdf1b4014
2023-11-11 00:36:14 +01:00
William Wilgus
dd1063fc2c [BUGFIX] path_append_ex() component string
basepath_max is used to truncate basepath
but was being applied to component as well in error

Change-Id: I3557b8544923f97c980363fe6931b505c0bd9c07
2023-11-10 18:17:39 -05:00
William Wilgus
7ac4d34dd6 Playlist slight optimizations for playlist_resume
Change-Id: I766ce032a9b6b36d750a9231ff9f5d5a0167e5a5
2023-11-09 21:03:25 -05:00
Marcin Bukat
7f455af905 hwstub lib: Introduce framework for device filtering
The rationale behind this was ability to filter usb device by
bus numer and device address. This allows to connect with selected
device in case there is more then one  connected device implementing
hwstub interface. For now only USB backend makes use of this
but the foundation is generic and can be easily extended to other
backends.

Change-Id: I618cfdeeb09162d5fa1002db00e40ea17c43e727
2023-11-09 02:06:18 -05:00
William Wilgus
154f10c2d2 boost cpu when resuming playlists
Change-Id: I6184075945b59b3fce2882dd56567b5cf3cb174b
2023-11-02 23:48:54 -04:00
roman.artiukhin
2030d681e4 Codecs: mp4: Fix sign overflow in seek by offset
Change-Id: I52f536ae959f989c3dc70a50cb802eb1b8615642
2023-11-02 09:40:56 +02:00
Christian Soffke
332a0fa968 Playlist sort/shuffle: Fix data type
I noticed that setting first_index to the
current track when shuffling a playlist
could fail in the Simulator.

Change-Id: Ic9467bd46a93aa2d2b765271110b0baee7058208
2023-11-01 15:35:58 -04:00
roman.artiukhin
63f75d22b4 Fix potential stuck on auto track change when buffering is stopped
pcmbuf  might wait for next track for proper crossfade/gapeless playback (see pcmbuf_start_track_change). It's not going to happen with stopped buffering.

Fixup for 831faa3b (#5394)

Change-Id: I969878d13a9f976566eef5b975beb1687b519a37
2023-11-01 16:24:32 +02:00
roman.artiukhin
11b8336c64 Fix rewind on resume is applied for skip length across tracks action after auto frequency switch
Add resume adjustments flag in mp3entry struct which is required for proper AUDIO_START_RESTART resume handling

Fixup for 4fb37ecb (#5196)

Change-Id: Ie9ecfe2b637bba38e442066333d71eeff01030ad
2023-10-31 13:46:07 -04:00
Christian Soffke
ba62798746 Playing Time plugin: Fix calculation for shuffled playlists
Playing Time produced incorrect results when
the playlist's first index wasn't 0.

Change-Id: I1c11b876e0e435c824c9ddc0863fd7ee76bda073
2023-10-31 17:58:17 +01:00
Christian Soffke
9c79a4449a Playlist Viewer Track Info: Fix displayed index
Index was incorrect for shuffled playlists

Change-Id: I72f7c07ddd1e6b6815e245ba775bd3aeba8fa5b2
2023-10-31 17:45:07 +01:00
roman.artiukhin
f377ad3ce7 Restore clearing resume info for current track in playing_id3_sync
Regression introduced in 3d5dd97c (#5426)

Without it current playlist keeps last bookmark info so next time track is played again from bookmark.

Change-Id: Ifeff43a4a2d380056ef8a389c3c72e7254db4080
2023-10-31 03:28:55 -04:00
William Wilgus
d78be6716b [BUGFIX] block SYS_EVENTS from some action switches
fixes some of the places where SYS EVENTS cause issues with action switches
that don't have handling for system events

more exist..

Change-Id: Ie6f4b05ed7ef1119d43e65ee49be8f754af83f52
2023-10-30 19:03:18 -04:00
Christian Soffke
d77c417fd1 Fix bookmarking/reloading after saving shuffled playlist
The resume index into the playlist file
that was used for bookmarks created immediately
after saving a shuffled playlist, or for reloading
the saved playlist (in case "Reload After Saving"
was enabled), tended to be incorrect.

The playlist file effectively isn't shuffled
anymore after saving it to a file, but the
resume index may still have to be rotated unless
playback has been stopped and resumed before
bookmarking, due to indices that are shifted
by first_index.

Change-Id: Id335a7a71adc216989d7b415bfa48237d92fd7b0
2023-10-30 14:09:51 -04:00
Christian Soffke
3f3e185460 Fix return value for playlist_get_resume_info
(Only) bookmark_is_bookmarkable_state()
seems to require a return value atm.

Change-Id: I701031285aad80a46ebca747d06f15d968c0e9c7
2023-10-30 13:57:01 -04:00
Christian Soffke
96dd251571 Remove playlist_shutdown from playlist_resume
This was added in 5e757b4 as a band-aid to
prevent control data from being discarded,
but has since become superfluous after
the removal of the control file cache in
2e99e21.

Change-Id: Ia7bd84f9442ec1103aee8d3c4454216719aa2d66
2023-10-30 18:49:42 +01:00
Christian Soffke
45746934c4 playlist_set_current: Fix outdated dircache filerefs
Entries from a previously playing playlist may not
have been replaced after selecting a track from
a different playlist in the Playlist Viewer when
playback was stopped (not paused), since the index
buffer of a playlist opened in the Playlist Viewer
is shared with the current playlist when nothing is
playing.

Change-Id: I939e302c73cabd0e9d969550143635e54db32bf0
2023-10-30 02:07:01 +01:00
Aidan MacDonald
1651254ba4 powermgmt: Don't force shutdown when externally powered
In rare cases, battery voltage at boot can be below the shutdown
threshold even if a charger is plugged in. This triggers a forced
shutdown and tells you to "RECHARGE!" despite there being plenty
of power available, which is annoying.

Tweak the forced shutdown check so it accounts for external power
sources; if any are present, battery voltage will be ignored.

Change-Id: Id6280b0b666df9eef31c37a03c07c9d6d3f50221
2023-10-29 11:22:01 +00:00
Christian Soffke
954dd0ff75 Playlist Viewer: Don't set unmodified after saving
90e3571 has made this redundant

Change-Id: Ic5cc374712d5eddfd4bd53ed083fa9ec2c5777c6
2023-10-29 01:29:18 +02:00
Christian Soffke
bdec7ed31b Suggest numbered filename when saving untitled playlist
+ update misleading comment for catalog_add_to_a_playlist's
m3u8name parameter (the keyboard picker will be shown even
if it's not NULL)

Change-Id: I7576a83fd40cdcdb7a912c90d8c1d9a8f25e277c
2023-10-28 18:24:00 -04:00
roman.artiukhin
831faa3b82 Rework auto playback frequency switch
Moved logic outside playback events to be executed early. Stops buffering when frequency change is detected (additional STATE_STOPPED state is introduced)

Removed no longer used AUDIO_START_REFRESH flag

Change-Id: Icfae61725a4d8ffb47380f561a011bda4841457b
2023-10-28 15:11:07 -04:00
Aidan MacDonald
90e35716e3 playlist: Rewrite playlist_save(), optimization & fixes
playlist_save() was a poorly thought out mess. This fixes the
glaring issues and hopefully ensures that saving the playlist
never loses state (such as queued tracks or modified status)
after save+resume.

Indices are now updated on the fly, which is faster and needs
no extra memory. But if an error occurs, the playlist will be
corrupted. There is currently no attempt to handle this since
errors should be unlikely, but some error handling needs to be
added in the future.

Change-Id: If8a5dbd6a596460be08ee0b7bab9f24337886ea4
2023-10-28 14:54:02 -04:00
Uwe Kleine-König
1ee152b5a4 sansaclipplus: enable usb-hid mouse support
Change-Id: Ifbebf9ff8474882a29378515e010e9c9d39df5c3
2023-10-27 19:31:41 +02:00
Solomon Peachy
0391f2410a FS13397: Fix ipodpatcher standalone build
Patch from revo

Change-Id: Ic41191c389d21861dec94f38418420d60f2596c3
2023-10-24 10:12:16 -04:00
roman.artiukhin
3d5dd97c48 Fix playing_id3_sync not properly syncing resume data
Fixes bookmark resume for tracks with different sample rates (should fix FS#13295)

Change-Id: I69c77f9397f9230381c31e7cf8b586bcbacd06fe
2023-10-22 09:26:20 -04:00
roman.artiukhin
4fb37ecbc6 Skip Length across tracks
Allows to use Prev button to skip length from the end of previous track.

Can be enabled with:
Settings -> Playback Settings -> Skip Length set to some time interval
and
Settings -> Playback Settings -> Rewind Across Tracks set to Yes

Change-Id: I99f234035a8a5acc9cbfe05ea83971ec5ddc59ea
2023-10-22 08:21:22 -04:00
Solomon Peachy
5c36643132 manual: Fix a formatting error in the database commit documentation
Change-Id: Idef95209db7bbef162eff0bed4bb83b4dbd5952c
2023-10-21 11:26:32 -04:00
Christian Soffke
34408af994 Fix warble error 4cfd7cc
Change-Id: I5609a1b98e00d5560a2c6523daf6da0025e421dd
2023-10-19 21:16:12 +02:00
Christian Soffke
4cfd7cc77d Track Info [Playlist] field: Add playlist name
For any selected track that is part of a playlist,
additional info about the list is now provided in
the [Playlist] field of the Track Info screen.

1) Asterisk indicates if playlist has been modified.
2) Playlist filename is visible, unless the current
playlist is *not* associated with a file on disk, in
which case the following will be shown instead:

- (Folder)    for unmodified folder playlists.
- (Dynamic)   for playlists that are neither associated
              with a playlist file, nor with a folder.

Change-Id: I9dcf7cbba4ac2e37b23413180a2b2bf4bbe5ee2a
2023-10-19 13:32:03 +02:00
Christian Soffke
759aaecdff Playlist Viewer: Eliminate 'dirty' flag
A playlist's explicit 'modified' flag is now used
for keeping track of whether it's been modified
in the Playlist Viewer, not just in case of the
currently playing list, but for other playlists
as well.

When you start playback of a track from the
Playlist Viewer, a playlist's 'modified'
status is now carried over to the current
playlist, so as to produce a warning when
there is an attempt to replace the list at
a later point. This also prevents (auto)
bookmarking of the playlist if it had been
modified in the Playlist Viewer prior to
becoming the current playlist. (Bugfix)

Change-Id: Ibc391fd69285f8a67d6ffb6d8c274df3d223974c
2023-10-18 18:23:57 +02:00
Christian Soffke
9cd4943950 Properties/Tagcache Track Info Retrieval: Skip files with errors (2)
Addendum to e3b2293

Don't abort even when the database has returned a filename,
since metadata retrieval may still fail.

Change-Id: I9e397c44a4c80f24e937f085efbd540f274822a0
2023-10-17 19:29:45 +02:00
Christian Soffke
f932522d8a WPS context menu: Set modified after reshuffle
Prevents incorrect bookmarking of permanently
(not just temporarily) shuffled playlists, which
need to be resaved, before they can be correctly
bookmarked.

Change-Id: I157d3be9d05117f7566ca72f3e736f96b42a165d
2023-10-17 12:29:41 -04:00
Christian Soffke
e3b22935f2 Properties/Tagcache Track Info Retrieval: Skip files with errors
File names exceeding the max length will not be retrievable
from the database. Skip such files, instead of cancelling
the operation at that point.

Change-Id: Ia6bc8a53be9ec181eb836956cc3d8b059b2d024f
2023-10-17 12:18:33 -04:00
Christian Soffke
f2af0711b0 Delete existing bookmark file when saving a new playlist
Deleting a playlist leaves its bookmark file behind.

When a new playlist was saved under the same name as an
existing bookmark file, unrelated bookmarks were shown
for the new playlist

Change-Id: I7332460a5f488c354f41195c8fff4cf4d66f4bbb
2023-10-17 12:05:57 -04:00
neofright
ebb7f33a9f Fix backlight undefined preprocessor typo
Change-Id: I8df1000def19688df57fab0c4c49e0c099e8060b
2023-10-16 20:36:48 -04:00
Solomon Peachy
5c791f2d2b lang: Update english-us "translation"
Change-Id: Icafb2252898483075ce02d3d7573c989917af8ec
2023-10-16 17:33:31 -04:00
William Wilgus
3c89adbdbd [Feature] lastfm_scrobbler don't return to plugin on WPS resume failure
if resume playback on start was set and there was nothing to
resume the menu was entered

Change-Id: Iab5f48e94f3de68091cf42781d6e3ab4575c1a84
2023-10-11 07:12:31 -04:00
Christian Soffke
75befe19ef Hide Bookmark menu for new dynamically generated playlists
The bookmark menu with the option to create a bookmark
was inadvertently displayed for new dynamic playlists,
that had no associated folder or playlist file on disk.
(e.g. after selecting some track from the database for
playback), until the playlist was modified by the user.

Change-Id: I9d6809e4d03603c651459415327f28e38162ad53
2023-10-10 12:03:52 -04:00