Make the album match predicate an exact match, rather than using the
"like" operator, in case there's a speed up from doing so.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apply the index sort to the fetch request itself, rather than applying
it to the resulting array afterward.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The list generator now selects only a list of unique album names, which
may include empty string as well as NSNull, so filter those as well.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Rewrite the album filter function to apply the filter predicate against
Core Data directly, which also requires filtering out deLeted entries so
they don't end up in the results, and also requires sorting the results.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The member that I set myself to indicate deletion has one capital letter
to differentiate it from the built-in "delete" property of managed
objects, which doesn't do what I want, so I had to dodge it with that
capitalization thing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fix the default volume scale reading for newly added tracks, as this
value should be 1 for any files which do not have tags. Also add an
override to the tag applying function, to reset the default on tag
re-read operations.
Please reload the tags or re-add your files to fix them playing
silently.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Add a compatibility getter/setter for URL, which was renamed to url, due
to Core Storage having a requirement of all attributes starting with a
lower case letter.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The PlaylistEntry class needs a compatibility wrapper for the Unsigned
member, as it is assigned by all of the inputs. Case sensitivity and all
that is. And unfortunately, Core Data requires all model members to
start with a lower case letter.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The copy action now includes formatted text of the selected entries when
copying, in addition to the supported file and URL types.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Completely rewrite the playlist storage once again, this time with a
much faster Core Data implementation. It still uses a little magic for
Album Artwork consolidation, but string consolidation doesn't seem to be
needed to reduce the disk storage size. Works much faster than my silly
implementation, too.
Old implementations are still kept for backwards compatibility with
existing playlists.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Jobs are meant to be serialized, so prevent multiple jobs from queueing
simultaneously, as they are not designed to interact with each other.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Long actions, such as file opening, playlist loading, metadata loading
and refreshing, etc, are now handled through NSProgress. Additionally,
a new status bar change displays the progress of the task instead of
the total duration of the playlist. Finally, app quit is blocked by a
running task, and if the app is quit while a task is running, it will
be delayed until the task completes, at which time the app will
terminate cleanly.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Prevent a race condition with deleting playlist entries while their
metadata is still being loaded by the player.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>