Commit Graph

330 Commits (c68b4b958525a0b9780fdd419519514b0938eb53)

Author SHA1 Message Date
Christopher Snowhill 01c38c9440
Playback Controller: Fixed title bar updating
This change had several components. For one, the delay of the dispatch
was increased from 5 milliseconds to 50 milliseconds. Two, the post to
the notification center was included in the delayed dispatch, so that
retains the PlaylistEntry object. Finally, the playlistController's
currentEntry object is reassigned from the input PlaylistEntry object,
which facilitates all watchers which are observing that variable for
updates. This final step also retains self for the callback, which
should be fine, since it's a quick dispatch with a short delay.

Fixes #335

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-12-09 22:35:01 -08:00
Christopher Snowhill 1b9f460538
Playback Controller: Remove "stopping" status use
This should not really be necessary for proper player operation any
longer, and can safely be removed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-12-09 21:18:07 -08:00
Christopher Snowhill 3663140064 Core Data Store: Handle concurrency properly
All concurrency from other threads should pass through the viewContext's
performBlock or performBlockAndWait functions, and no other way. So now,
all access to Core Data is either happening on the main thread, or by
using these code blocks, all of which will wait for their access to
proceed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-10-30 16:54:33 -07:00
Christopher Snowhill 504ddcf82b Sparkle: Update API a bit
This updates the API interface calls a bit, and borrows about 20 lines
of code from WireShark.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-10-28 00:02:20 -07:00
Christopher Snowhill ce723fd44e Better locking behavior for playlist storage
This should fix up potential locking issues with maintaining a copy of
the results set while certain other background actions may happen, such
as the player updating play counts while playing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-10-11 22:59:46 -07:00
Christopher Snowhill 8809c0d257 [Sandbox Paths] Automatically clean up old paths
Clean up redundant paths automatically, and on startup. Also refresh the
preferences dialog path list every time it is opened.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-24 23:15:10 -07:00
Christopher Snowhill 051b86cbaf [Core Data] Add access locking
Apparently we need this to prevent Core Data from stomping on itself
when another thread accesses it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-15 07:00:29 -07:00
Kevin López c735c8f387 [Translation] Privacy policy URL can now be loaded from strings files
Signed-off-by: Kevin López Brante <kevin@kddlb.cl>
2022-07-09 16:24:16 -07:00
Christopher Snowhill 44e1fc5c49 [Playlist] Increase default font size to Regular
Regular control size ends up being 13 points, rather than the previous
default of Small control size, which ended up being 11 points.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-07 17:56:25 -07:00
Christopher Snowhill a0621b2537 [File Association] Correctly play files on open
When opening files from external association, such as opening files, or
opening folders with Cog, correctly obey the configured clear and play
or enqueue and play actions, by playing the new additions.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-06 17:04:02 -07:00
Christopher Snowhill 7e516f8cfe [Playlist Loader] Load files in the background
Load new playlist entries in the background, asynchronously.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-06 14:28:34 -07:00
Christopher Snowhill c4790af7c0 Reformat spaces to tabs
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-05 13:54:17 -07:00
Dzmitry Neviadomski 81c98736fa Add preference to choose between SceneKit and DDB spectrum. 2022-07-05 13:54:10 -07:00
Christopher Snowhill 9e66838b9b [Equalizer] Remove unnecessary code
This code is obsolete, remove it.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-03 22:37:52 -07:00
Christopher Snowhill 5d7a9798fe [Synthesizers] Implement default overrides
Default time, fade, loop count, and sample rate may now be overridden.

Synchronized preferences strings tables. Spanish translation of new
options pending, new releases won't be pushed until they're complete.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-07-02 01:27:01 -07:00
Christopher Snowhill 099588b7bd Restore the File Tree, now with a chooser button
Revert "Remove the file tree, as Sandbox does not permit"

This reverts commit 35400e1320.

This also changes how the File Tree choosing works.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-30 16:59:35 -07:00
Christopher Snowhill 73c4360b1d [Info Inspector] Improve formatting of sample rate
Sample rate now has a locale independent formatting, and no longer uses
scientific notation for large numbers.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-30 00:28:30 -07:00
Christopher Snowhill 35400e1320 Remove the file tree, as Sandbox does not permit
The Sandbox does not permit such controls to exist.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-29 12:00:12 -07:00
Christopher Snowhill a35459719d [Sandbox] Show grant dialog on launch if empty
If there are no configured paths, show the grant page on every startup.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 23:14:21 -07:00
Christopher Snowhill 112366c850 [Crash Handling] Enable exceptions for debugging
Debug builds should have exceptions enabled, rather than crashing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-28 20:27:43 -07:00
Christopher Snowhill 038b0b8067 [Play Events] Don't bug on end of playlist
Don't bug out on end of playlist, when didBeginStream will receive a nil
track pointer, which should result in unsetting the current track in the
player, and not send a DidBegin notification to everything, including
the visualization views' event handlers.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-26 05:28:43 -07:00
Christopher Snowhill 80adb85b36 [Path Suggester] Automatically pop where required
The Path Suggester will now automatically open when new files are added
to the playlist and a given path is not in the sandbox settings. It will
also pop for both the File Tree and MIDI SoundFont path configuration
settings being changed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-24 00:29:50 -07:00
Kevin López a4692b80a4 [Main Menu] Added Privacy Policy link in App Menu
Signed-off-by: Kevin López Brante <kevin@kddlb.cl>
2022-06-21 19:31:06 -07:00
Christopher Snowhill 05da7450da [Crashlytics] Require asking user consent
Require asking user consent for data transmission on first launch, or
otherwise disable sending crash reports by default.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-21 19:16:23 -07:00
Christopher Snowhill d59b5335e9 Revert "Removed Sparkle"
This reverts commit b54ee58ec3.
2022-06-21 18:00:30 -07:00
Christopher Snowhill b54ee58ec3 Removed Sparkle
Removed Sparkle in preparation for App Store release.
2022-06-21 06:05:45 -07:00
Christopher Snowhill 4330226776 [Core Data Store] Fix empty URL filtering
Empty URL filtering was implemented incorrectly. Fix that.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 23:18:37 -07:00
Christopher Snowhill dbdcad6c04 [Dock Icon] Refuse to update if plaque didn't load
Refuse to update the dock icon image if the dock icon plaque image fails
to load somehow. Really weird case.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 21:34:05 -07:00
Christopher Snowhill c89837c0f8 [Play Count] Remember added count across sessions
Remember if play count was already tracked for the current file across
restarts, if resume playback after restart is enabled.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 19:13:33 -07:00
Christopher Snowhill 9d559481d3 [Sandbox] Disable distributed iTunes notification
This notification can't escape the sandbox anyway, and I forgot to
remove it after adding the app sandbox code again.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 16:43:21 -07:00
Christopher Snowhill c23bece62c Reintroducing App Sandbox, and more
- Implemented App Sandboxing in a more friendly manner.
- All sandboxed paths will need to be set in Preferences. Set as loose
  a path as you want. The shortest path will be preferred.
- Removed Last.fm client support, as it was non-functional by now,
  unfortunately. Maybe something better can come in the future.
- Added support for insecure SSL to the HTTP/S reader, in case anyone
  needs streams which are "protected" by self-signed or expired
  certificates, without having to futz around by adding certificates to
  the system settings, especially for expired certificates that can't
  otherwise be dodged this way.

If you want to import your old playlists to the new version, copy the
contents of `~/Library/Application Support/Cog` to the alternate sandbox
path: `~/Library/Containers/org.cogx.cog/Data/Library/Application `...
...continued...`Support/Cog`. The preferences file will migrate to the
new version automatically.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-20 03:35:29 -07:00
Christopher Snowhill 8009d911c2 [Crashlytics] Remove unnecessary extra log sending
The log sending should be automatic, this is unnecessary.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 21:48:33 -07:00
Christopher Snowhill e071b4d913 [Crashlytics] Remove AppCheck from debug builds
Remove the AppCheck code from the debug builds, as it's not even enabled
on the project in Firebase anyway.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 21:46:30 -07:00
Christopher Snowhill 071d23b1c6
[SceneKit Visualization] Refine blocklist again
* Remove exception variable setter

Remove SceneKit crash variable setting exception
handler from NSApplication delegate.

* Restrict SceneKit to 10.13, 10.14, and 11.0+

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 21:42:39 -07:00
Christopher Snowhill 385335b37c [Core Data Storage] Refine deleted/empty items
Remove empty items also with empty URL fields.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 20:04:30 -07:00
Christopher Snowhill 8962403e2a [Playback Controller] Remove blank line
Remove a blank line in the code, for no real reason, other than
tidiness.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 01:43:35 -07:00
Christopher Snowhill 8306bd31f4 [Playback Controller] Reformat metadata handler
Metadata notifier should have been reformatted to use the properties as
dotted members, and also check for empty strings.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 01:43:08 -07:00
Christopher Snowhill 7fcfdb373b [Playback Status] Remember last play position
Remember last play position in the playlist, rather than using an index
variable to store its position and play time. Still store whether the
player was last playing in a configuration variable, though.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 01:42:27 -07:00
Christopher Snowhill cd14377dcd [Now Playing Spam] Don't crash if nothing playing
Don't crash on now playing spam hotkey if no track is currently playing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-19 00:20:40 -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 404d354918 [Playback Notifications] Fix empty hyphen on tags
This change needed to be applied in two places, oops, forgot the modern
macOS case.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 19:03:25 -07:00
Christopher Snowhill 3a1599d22e [Playback Notifications] Oops, fix breakage
That change broke notifications. Reverting.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 19:02:10 -07:00
Christopher Snowhill 7cad442b73 [Localization] Fix another unlocalized string
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 18:26:42 -07:00
Christopher Snowhill 20904cf2c4 [Playback Notification] Prevent sending blank tags
Prevent the notification balloons from displaying empty hyphens or tags
if either album or artist is empty but not nil.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 18:20:12 -07:00
Christopher Snowhill 41d4c7458e [Translations] Load PlaylistEntry error messages
These error messages should be loaded from the main bundle, where the
class is located.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:16:43 -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 1c2ecc1c7c [Playlist] Handle invalid files in a better way
Invalid files may include nil URLs, which should be skipped or stop
playback altogether. Invalid files will be marked as an error, and
stop playback.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-18 16:09:41 -07:00
Christopher Snowhill 88b7cd6352 [Crashlytics] Added logging of track events
Added logging of track metadata load and track playback events, to aid
with crash logging.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 22:34:51 -07:00
Christopher Snowhill cbcbdf893d [Spectrum Visualizer] Add crash check for SceneKit
The SceneKit visualizer now has a crash check, which will trigger if an
exception is thrown by the app.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 22:15:14 -07:00
Christopher Snowhill 8acd7fb8f6 [Crashlytics] Add AppCheck for debugging builds
Enable Firebase AppCheck in debugging builds, so that more info may be
logged.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-06-17 19:18:41 -07:00