Commit Graph

389 Commits (9d558a89ab6502224fd6dc61c670ba5d97d29db0)

Author SHA1 Message Date
Christopher Snowhill 9d558a89ab [Playlist] Guard Open in Finder against empty set
Guard Open in Finder against being called on a playlist with no
selection, which may happen if the action is triggered on an empty
playlist, which would cause an array out of bounds access error.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-13 16:28:29 -07:00
Christopher Snowhill 686cf95795 [Playlist] Guard entry selection against empty set
Guard the playlist entry retrieval function against being called on an
empty playlist, because an empty playlist would result in a division by
zero error to occur here.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-13 16:27:32 -07:00
Christopher Snowhill 55c623c9a0 [Legacy XML Playlist] Fix import if queue missing
If there is somehow a legacy XML playlist, and there is no queue entry
in the plist, then it should not throw an exception from trying to add
a nil object to the return dictionary.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-13 01:46:44 -07:00
Christopher Snowhill 90b83f8f51 [Various] Clean up various warnings
Various warnings related to uninitialized variables, or setting values
to variables that would not be used later or would be overwritten by per
loop initializers.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 13:42:42 -07:00
Christopher Snowhill f22a74ab3a [Translation Support] Fix several string constants
Several string constants were not fetching from the translation strings
table. Fixed this.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-11 13:34:57 -07:00
Christopher Snowhill f11ef2d887 [Playlist Controller] Fix ambiguity with Xcode 14
This NSArray member call is ambiguous, but Xcode <14 allowed it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-07 18:57:19 -07:00
Christopher Snowhill 0ba766023e Playlist/Time: Simplify font initialization
Apparently this simpler API already existed on a minimum of 10.11 for
creating a system font with monospaced digits.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-03 16:46:37 -07:00
Christopher Snowhill 05f17ea950 [Menu] Add Stop after Selection to context menu
Since the existing code already supports setting any arbitrary track as
a stopping point, add a menu interface to toggle Stop After for any
track in the playlist. Stop After will be removed from the given track
after it has been played. Stop After will not be remembered on disk.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-30 22:23:02 -07:00
Christopher Snowhill 0f10543566 Improve spam formatting string in two ways
For one thing, improve it so that if the tracknumber field is present,
but zero, it doesn't show the number sign in the spam. For the second,
only show the track artist field if it differs from the album artist.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:10:27 -08:00
Christopher Snowhill 1b48459eaa Track number column should also sort by disc
Apparently, the sort descriptors are going by data members of the array,
not by the column identifiers, or their textual contents.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-18 02:23:15 -08:00
Christopher Snowhill 60a4266840 Fix sorting of playlist
Unfortunately, the track number column will always bug out and pop the
indicator back over to the Album Artist column. No way around it. The
control is just buggy like that.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-18 01:57:19 -08:00
Christopher Snowhill 0902703ee1 Playlist: Fix sorting by the track number column
Should now properly sort by album artist, album, then disc/track number.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-17 17:07:47 -08:00
Christopher Snowhill 5611d08df1 Reduce memory usage of adding tracks
Significantly reduce the memory footprint of adding tracks to the
playlist, by coalescing the NSString and NSData objects in the info
dictionaries as they are being loaded in the background, into a common
data set which will then be discarded when the whole job is completed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 21:38:43 -08:00
Christopher Snowhill 3de43b55a7 Significantly reduce memory usage all around
Added a string dictionary for deduplication of metadata, and actually
initialize both it and the art dictionary on startup, so they actually
work like they should.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 16:57:47 -08:00
Christopher Snowhill b8057b7c29 Add support for AVIF album artwork
Import libavif and libaom, specifically built only for decoding, not
encoding.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:52:51 -08:00
Christopher Snowhill b8a98e301e Metadata loading: Correctly merge over empty tags
Metadata versus properties merging, correctly merge over empty fields if
they are assigned with empty strings or zeroed numbers, instead of only
merging over completely missing fields.

Fixes emailed bug, CUE Sheet metadata reading, primarily.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 20:02:18 -08:00
Christopher Snowhill d7becdf01a Add a nil pointer check for metadata read
No idea if this is needed or not.
2022-02-11 06:00:36 -08:00
Christopher Snowhill bf88c57454 Minor artwork caching changes
Art ID should be set on new files when they are stored into the
database, and the album art property should be affected by assigning to
the artId property, since it affects the caching identifier.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 22:45:26 -08:00
Christopher Snowhill 740fdfa883 Attempt to wrangle memory usage from artwork
Now cache around NSData objects of individual pieces of album art,
unique by their byte contents. And the artwork image cacher will also
use the art ID keys from the database as the cache keys for NSImages,
so they'll not only be only read once per unique image, but also tracks
can have unique artwork per track, if the files so feature it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 22:37:37 -08:00
Christopher Snowhill 2e52066293 Skip to next on trash, else stop playback
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 21:48:30 -08:00
Christopher Snowhill 2e1460f72d Only trash regular files
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 21:48:08 -08:00
Christopher Snowhill 5411a60ea1 Added option to remove tracks to the trash
Fixes #23

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 21:35:13 -08:00
Christopher Snowhill 39dcb88728 FFmpeg input: Support reading metadata
Where TagLib is not being employed, use FFmpeg to read tags where
possible. This allows reading tags from files like IFF. It reads it
through properties, otherwise allowing tag readers to function like
usual.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 15:29:13 -08:00
Christopher Snowhill 8f1143818b Replace playlist status icons with SF Symbols
On Big Sur and up only, of course.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 01:51:40 -08:00
Christopher Snowhill a4387dc6d1 Playlist now supports dragging tracks out of app
Playlist now supports dragging copies of URL references to other apps,
including Finder, and possibly other audio players. The chosen drag
operation is to copy files.

Fixes #75

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 01:32:09 -08:00
Christopher Snowhill 5330295a97 Fix array bounds issues with album shuffle builder
The shuffle list builder was encountering errors when some album tags or
empty album tags led to empty lists.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-10 01:14:42 -08:00
Christopher Snowhill df63726128 Track properties take priority over metadata read from tag readers
This allows inputs to override things with self-read tags and such, such
as ReplayGain tags.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 21:26:17 -08:00
Christopher Snowhill 64c4aa2e25 Handle deleting the current track gracefully
Now it should flow playback correctly to the next remaining track after
the block of deleted tracks. And if the user deletes the next queued
track, it will still be queued to flow past the deleted block. If the
user undoes their deletes and restores the tracks, playback will resume
after the originally deleted track.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-09 21:04:17 -08:00
Christopher Snowhill 7cea254f4c Implement framework for dynamic metadata updates
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 21:21:53 -08:00
Christopher Snowhill b927f4c02b Replace more NSDictionary use with literals
Use literals to initialize fixed NSDictionary objects in various places.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-08 19:56:04 -08:00
Christopher Snowhill 6120fce40a Metadata: Fix length field on track reloading
This fixes the dynamic length field not updating correctly after a track
info reload, which breaks the seekbar when reloading the current track.

Fixes #227

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-07 03:03:39 -08:00
Christopher Snowhill 95fb65527f Playlist Entry / SQLite: Add channel config field
Add channel config field to PlaylistEntry and the SQLite backing store.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-07 01:11:30 -08:00
Christopher Snowhill 85c7073649 Reformat my own source code with clang-format
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-06 21:49:27 -08:00
Christopher Snowhill 6d9f1be7ea Playlist Controller: Stop when deleting current
When deleting the currently playing track, stop playback, because the
player engine doesn't like dealing with the current playing track not
actually having a playlist reference to go with it. Better stop playback
instead, as a safety check.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-04 19:54:43 -08:00
Christopher Snowhill 85fd3836c0 Debug logging: Added logging of playback and tags
Added a logging method that indicates starting playback of a given URL,
and added a debug build only logging of every metadata load event.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-29 16:34:43 -08:00
Christopher Snowhill 2541633c17 Playlist Entry: Display full URL for remotes
For Playlist Entries that are not File URLs, return the full absolute
URL for path queries, so the playlist path column will show the full
URL instead of a useless reduced path string.

Fixes #214.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-01-27 00:11:14 -08:00
Christopher Snowhill d8b16e44c7 SQLite Store / Drag and Drop: Now correctly store changes made by dragging playlist entries around to the database 2022-01-24 06:07:13 -08:00
Christopher Snowhill 8e5c62f185 Info Inspector: Now displays ReplayGain info as tooltip for status text 2022-01-22 20:44:06 -08:00
Christopher Snowhill b54b10861b Playlist View: Enable column text tightening before truncation 2022-01-22 15:03:30 -08:00
Christopher Snowhill 5bf5830b17 Info Inspector: Now displays ReplayGain tag presence 2022-01-21 23:49:07 -08:00
Christopher Snowhill 9bfc51cbf4 Info Inspector: Add field to display whether a track has an embedded CUE Sheet 2022-01-21 23:19:32 -08:00
Christopher Snowhill 0c4d5002f6 Metadata: Now supports storing cuesheet tags and encoding quality status properties 2022-01-21 22:38:54 -08:00
Christopher Snowhill 2165d37144 Metadata: Now supports disc number field where possible 2022-01-21 21:49:17 -08:00
Christopher Snowhill bde3f552d9 Drag and Drop: Fixed jank with dragging, especially undo and redo 2022-01-21 16:11:24 -08:00
Christopher Snowhill 391fc474f3 Drag and Drop: Made DND undo possibly less janky 2022-01-21 15:00:27 -08:00
Christopher Snowhill 297b7b2909 Playlist View: Fix default sorting and playlist refreshing, which fixes playlist search bugging out 2022-01-21 00:16:29 -08:00
Christopher Snowhill 0f90dd3b3e Playlist View: Support undoing and redoing Drag and Drop operations within the playlist 2022-01-20 21:48:23 -08:00
Christopher Snowhill c07b268288 Playlist View: Adjust threshold for expansion tooltip assignment 2022-01-20 18:18:05 -08:00
Christopher Snowhill 4e918fc868 Playlist View: Refresh playlist entries when queue is emptied 2022-01-20 17:58:24 -08:00
Christopher Snowhill 973664f3b3 Playlist View: Correctly refresh playlist tooltips when queue is manipulated 2022-01-20 17:54:02 -08:00