Commit graph

252 commits

Author SHA1 Message Date
Christopher Snowhill
84d0cbee3c [Playlist Controller] Remove unused function
Remove a leftover function from previous code.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:01:11 -07:00
Christopher Snowhill
a2d8e0ec42 [Track Info] Add play count tabulation and display
Add play count data collection, including first seen times for every
file first added to the playlist. Data is indexed by album, artist, and
title, or by filename, whichever matches first. Add interfaces to
AppleScript automation definition as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 23:00:08 -07:00
Christopher Snowhill
ecb30dd734 [Translation Support] Update strings a bit.
Update the strings, and remove the comments where they won't be used.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:10:18 -07:00
Christopher Snowhill
54b102f09e [Playlist] Fix refresh handling range
Apparently, somehow, indexes in obscene ranges hit this code, and cause
exceptions. Strange.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 15:50:25 -07:00
Christopher Snowhill
4b4776fbc0 [Shuffle Function] Make album predicate exact
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>
2022-06-17 17:25:42 -07:00
Christopher Snowhill
e9b02d54f4 [Core Storage] Apply index sort to fetch request
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>
2022-06-17 17:20:45 -07:00
Christopher Snowhill
cad6ddac02 [Shuffle Function] Greatly optimize list generator
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>
2022-06-17 17:03:50 -07:00
Christopher Snowhill
9820571a94 [Shuffle Function] Rewrite query for Core Data
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>
2022-06-17 17:02:24 -07:00
Christopher Snowhill
d972a6eaf5 [Playlist] Correctly handle deleted items
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>
2022-06-17 04:34:17 -07:00
Christopher Snowhill
789e8e432e [Playlist Storage] Add another compatibility hook
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>
2022-06-16 17:43:48 -07:00
Christopher Snowhill
4c95c943ef [Playlist Storage] Rewrite to use Core Data
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>
2022-06-16 07:14:33 -07:00
Christopher Snowhill
5bca70d141 [Job Queue] Prevent multiple jobs from stacking
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>
2022-06-15 01:10:53 -07:00
Christopher Snowhill
92573ec088 [Job Queue] Overhauled long action handling
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>
2022-06-15 01:01:45 -07:00
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
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
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
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
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
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
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
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
b54b10861b Playlist View: Enable column text tightening before truncation 2022-01-22 15:03:30 -08:00
Christopher Snowhill
2165d37144 Metadata: Now supports disc number field where possible 2022-01-21 21:49:17 -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
Christopher Snowhill
7cc4ee22f7 Playlist View: Fix centering and sizing of status icons 2022-01-20 17:37:56 -08:00
Christopher Snowhill
8c63e8fde3 Playlist View: Now using monospaced numbers on all fields 2022-01-20 17:26:30 -08:00
Christopher Snowhill
b317bfcdc2 Playlist View: Remove some bugs in the sizing 2022-01-20 17:02:34 -08:00
Christopher Snowhill
db867c841c Playlist View: Add status tooltip to status icon 2022-01-20 15:54:40 -08:00
Christopher Snowhill
a4c3509e75 Playlist View: Refresh entire rows on status changes to refresh tooltips 2022-01-20 15:51:24 -08:00
Christopher Snowhill
b78e55a50c Playlist View: Fix status message tooltip 2022-01-20 15:39:29 -08:00
Christopher Snowhill
2b4de1033d Playlist View: Replace Cell-based table with View-based table. It needs some work still, though. 2022-01-20 14:59:26 -08:00
Christopher Snowhill
684951bdc0 Change a bunch of NSArray declarations to const collection literals 2022-01-18 18:12:57 -08:00
Christopher Snowhill
7fe67b1630 Implement dock icon progress bar indicator for many processing operations, including adding tracks, removing tracks, and loading or reloading track metadata 2022-01-09 02:10:08 -08:00
Christopher Snowhill
00052130a0 Revert ea589b2635, and fix reloading info for entries on Intel, by invoking the reloader in the background instead of directly calling it from the UI thread 2022-01-07 02:12:49 -08:00
Christopher Snowhill
2445cc94a9 - Retrieve profile paths properly instead of hard coding
- Display playlist total duration in units up to weeks and down to just seconds, and only pluralize units as necessary
- Major change: Implemented a SQLite disk backed playlist, track data, and queue storage system, which will be synchronized from the player in real time, and will hopefully survive system or app crashes. Existing plist playlist will be imported on first run, and removed on shutdown.
2021-12-24 01:01:21 -08:00
Christopher Snowhill
217b3d4cf9 Attempt to clean up 10.13+ stuff with fallbacks to the old ways 2021-09-23 00:49:51 -07:00
Christopher Snowhill
922e657f0b Context menu: Add option to reload metadata from existing playlist entries 2021-07-03 15:32:13 -07:00
Christopher Snowhill
13bd399b31 Clean up most warnings and update some dependencies 2021-04-29 18:16:24 -07:00
Christopher Snowhill
583b8f3cb4 Hopefully fix Drag and Drop for everyone 2021-02-06 00:02:55 -08:00
Dzmitry Neviadomski
c1da9a66e1 Modernize several classes.
Use modern ObjC syntax.
Use new Pasteboard APIs.
Explicitly declare protocols.
2021-01-31 02:14:08 +03:00
Dzmitry Neviadomski
730276a7e7 Modernize DNDArrayController. 2021-01-28 01:09:09 +03:00
Christopher Snowhill
072c4346cf Fix album shuffle again 2019-12-15 18:12:11 -08:00
Christopher Snowhill
2ad9584fb2 Rejigger shuffle list generator for albums mode, to insert the current album at the start of the list, starting from the current track 2019-10-24 17:18:51 -07:00
Christopher Snowhill
c8f91c5092 Implemented album shuffle mode, which somehow wasn't implemented at all 2019-10-12 18:27:02 -07:00
Christopher Snowhill
67495009ff Updates for new build system. 2018-06-28 04:03:37 -07:00
Christopher Snowhill
54bd1db745 Ignore RepeatOne only when manually skipping tracks, not when playing normally. 2017-12-23 23:55:33 -08:00
Christopher Snowhill
524e161789 Track skip no longer gets stuck on the current track when in Repeat One mode. 2017-12-23 23:33:11 -08:00
Chris Moeller
0e3644177e Updated everything else to ARC, and plugged a release cycle. 2016-05-05 13:05:39 -07:00
Chris Moeller
25236a254a On second thought, let's not allow other repeat modes to wrap around the playlist boundary, either 2015-02-07 23:38:16 -08:00
Chris Moeller
321a5ea23f Fix repeat none and repeat all being swapped 2015-02-07 23:36:23 -08:00
o1
b3072709e4 Fixed possible track idx overflow causing crash 2015-01-07 15:10:33 +03:00
Chris Moeller
1b4ef20d19 Added 'days' to playlist total time, but only if the total hours is 24 or greater 2013-10-20 21:16:07 -07:00
Chris Moeller
b461e774fd Fixed undo/redo handling when the playlist is sorted, including undo/redo interleaved with different sorting orders 2013-10-18 01:47:48 -07:00
Chris Moeller
aa2676f605 Made duplicate and dead item removal correctly remove the items by their arranged indexes 2013-10-18 00:25:37 -07:00
Chris Moeller
2f5769d668 Made arranged item remover actually remove the correct arranged items and use the correct indexes 2013-10-18 00:17:03 -07:00
Chris Moeller
7a9e4a720c Added Remove Dead Items command 2013-10-18 00:14:53 -07:00
Chris Moeller
2d5f340011 Added Remove Duplicate Items command 2013-10-18 00:13:27 -07:00
Chris Moeller
759aeab4fb Implemented pause on startup 2013-10-12 19:16:47 -07:00
Chris Moeller
697ed357a9 mamburu: Being unable to remove an entry from playlist is fixed 2013-10-11 12:39:05 -07:00
Chris Moeller
521eb67183 mamburu: Randomizing playlist is now undoable, adding playlist entry no longer causes un-randomization 2013-10-11 12:33:58 -07:00
Chris Moeller
e5a648578b mamburu: Logging improved, no more excessive logging in release builds 2013-10-11 05:03:55 -07:00
Chris Moeller
ec0e45381e Cleaned up most of the warnings, eliminated use of deprecated APIs, and fixed the hotkeys crashing. 2013-10-03 01:00:58 -07:00
Chris Moeller
25bf55459e Silenced some warnings 2013-09-29 17:27:55 -07:00
vspader
7e3f257090 Fix shuffle. 2009-03-24 20:12:52 -07:00
vspader
7819210b96 Added interface for shuffle albums mode. 2009-03-09 21:04:46 -07:00
vspader
d6a0b0670e Playback events for last.fm and growl are now done in the background via an operation queue. Removed hack to load metadata for autoplay. Now metadata is reloaded for each file you play. 2009-03-05 20:37:44 -08:00
vspader
af6c5f343a Cleaned up logic a little. 2009-02-28 14:40:30 -08:00
vspader
03937f480b Cleaned up modified add behavior. 2009-02-28 14:22:33 -08:00
vspader
606cdef1d0 Fixed last commit. 2009-02-28 12:53:24 -08:00
vspader
3cd7402d3d Re-request the next stream when the shuffle/repeat mode changes. 2009-02-28 12:26:43 -08:00
vspader
fda5d50712 If you change the playlist near the end of a song, it should now play the correct song. 2009-02-28 10:57:21 -08:00
vspader
489063ad33 Register defaults for shuffle/repeat. 2009-02-28 10:18:56 -08:00
vspader
df2fa22a93 Shuffle/Repeat are now remembered. 2009-02-28 10:06:21 -08:00
vspader
c902c96a19 Fixed shuffle images. 2009-02-27 22:40:50 -08:00
lmsilva
dda74d0608 fixed seek slider from becoming active & disabling it when STOP occurs 2008-11-21 15:14:23 +00:00
vasfed
584710ffb1 Changed playlist behavior preferences to be pop-up buttons with choices 2008-05-18 09:38:53 +00:00
vasfed
f9f0891f6c Fixed a bug in APL plugin with image files containing # in name 2008-05-18 08:04:46 +00:00
vasfed
e063790e93 Updated APL plugin to use new protocol
Added support for behavior modifiers on addition/opening of files
Added Command+Control as modifier for open/enqueue
2008-05-09 21:24:49 +00:00
vspader
dbfa0363de Some cleanup and fixes for the toggle menu. 2008-03-09 02:53:13 +00:00
vspader
3375e15a83 Queue is now a toggle. 2008-03-08 23:57:54 +00:00
vspader
569a3e79cc Fixed scrolling behaviour. 2008-03-04 01:14:51 +00:00
vspader
cf46d16a56 Remove concurrency! Mwahaha! Also, moved updateTotalTime so it's done after all operations. Now it's actually usable while loading time. 2008-03-03 02:25:52 +00:00
vspader
276176a80c Updated playlistLoader to be CONCURRENT! Mwahahaha!
total time is now automatically updated by observing PlaylistController.arrangedObjects.length
2008-03-03 02:09:56 +00:00
vspader
d7826ee144 Clear stopAfter status when changing the song. Fixed bug where status wasn't dependant on stopAfter. 2008-03-01 03:35:27 +00:00
vspader
3cdca94207 Split status up into bunches of properties and made it a readonly property. 2008-03-01 03:29:21 +00:00