Commit graph

4085 commits

Author SHA1 Message Date
Christopher Snowhill
67fdd0741f SceneKit Visualization: Minor vDSP optimization
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Gather maximum bands using vDSP, and also align the structure size to 4
floats per step.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-13 18:50:07 -07:00
Christopher Snowhill
43e4dc4955 Bug Fix: Check memory allocations for FFT state
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-13 18:50:02 -07:00
Christopher Snowhill
7988d3be32 Bug Fix: Free FFT/DFT state on shutdown
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-13 18:49:58 -07:00
Christopher Snowhill
b693c946b8 Bug Fix: Zero out DFT state pointer on free
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-13 18:49:53 -07:00
Christopher Snowhill
6340b08308 Visualization: Rewrite FFT calculation code
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
This code, based on some other vDSP information I found, performs the
DFT in a different fashion, and also pre-converts the spectrum data into
decibel levels, so the DeaDBeeF analyzer calculation code doesn't need
to convert the values itself any more.

Maybe this will also get rid of the use after free problem somewhere in
the audio code? Who knows?

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-12 19:56:43 -07:00
Christopher Snowhill
78ec3d39eb Bug Check: Handle null pointers in FFT code
This shouldn't happen, but it should be guarded properly nonetheless.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-12 19:56:38 -07:00
Christopher Snowhill
10bfb204b5 Bug Check: seek handler type check to fix crash
Somebody somehow sent this an NSMenuItem? I don't have any UI handlers
calling this IBAction from menus, so someone is messing around with the
code and not removing my crash reporter.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-12 19:56:33 -07:00
Christopher Snowhill
23334dd452 Bug Fix: Disable buggy Selection Follows Playback
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Disable this by default, as it doesn't take output buffering into
account, so cursor moves up to 20 seconds ahead of what is actually
audible on the output device.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-11 19:03:30 -07:00
Christopher Snowhill
23be3b7f03 Bug Fix: Prevent track transition race condition
A race on the source queue setter could cause a crash. Prevent that by
not attempting to set a nil input node.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-11 19:03:25 -07:00
Christopher Snowhill
cb9c4d9c01 Bug Fix: Stop track fades from hanging on occasion
Track fades could hang if fired in rapid succession. Now each fade will
be guaranteed to resume input feeding upon removing the current input to
the background fade-out queue.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-11 19:03:21 -07:00
Christopher Snowhill
c0d411f002 Cue Sheet: Remove unused variable
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Forgot to clean this up.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-11 00:24:39 -07:00
Christopher Snowhill
747bd51bb7 Cue Sheet: Redo file reading and text decoding
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Attempt to decode random encodings in a different way than before.
Hopefully this works a little better for some people.

Fixes #434

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-11 00:19:26 -07:00
Christopher Snowhill
29658129d5 Fix Xcode paths again
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Xcode can be really, really stupid sometimes. Come on, absolute paths?

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-10 23:03:39 -07:00
Christopher Snowhill
4ac4787cc1 Project Fix: Remove non-existent paths
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
These referenced libMAD, which has been replaced. The effect was
essentially harmless, except for a compile time warning.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-09 23:57:58 -07:00
Christopher Snowhill
a421955c4a Bug Fix: Set URL object before attempting to log
This was logging a potentially unassigned variable. Oops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-09 23:57:54 -07:00
Christopher Snowhill
88f2dfc338 Bug Check: Return silence instead of null URL
This is technically an error condition, but handle it in a non-crashy
way.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-09 23:57:50 -07:00
Christopher Snowhill
b8d6ab5c8c Bug Fixes: Some more generic NULL URL checks
Also catch some invalid URLs in the database.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-09 23:57:46 -07:00
Christopher Snowhill
794a9d2e7c Bug Fix: Chase the dict keys with periods problem
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
This was a more prolific problem than I thought. Hopefully that's the
last that I need to fix.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-07 06:30:14 -07:00
Christopher Snowhill
a76c4c7426 Tag Reading: Better handle tag names with periods
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Oops, I forgot that Cocoa KVO treats key names with periods in them as a
special case, assuming that each dotted word is a separate nested object
from the others. Work around this by using Unicode character replacement
that will hopefully dodge the issue.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-07 05:44:01 -07:00
Christopher Snowhill
b5403522e0 Sandbox: Fix missing file handler crash
Apparently, NSURL path for fileURL can return nil if the resource no
longer exists, or something. Better fail gracefully than cause a crash.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-07 05:43:55 -07:00
Christopher Snowhill
dfd95b0a37 Rubberband: Fix end of track reset for threading
This end of track restart notification may come from a different thread
than the processing thread. Wait on the thread to complete.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-07 05:43:50 -07:00
Christopher Snowhill
0e06f5457c Bug Fix: Add some safety checks to URL handlers
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
A few places could have used nil checks, but there shouldn't be anything
passing nil URLs to these. Well, just in case, at least it won't lead to
crashes or something...

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 01:27:54 -07:00
Christopher Snowhill
1d847eb96c Bug Fix: Really old legacy code error crash fix
This legacy playlist filename handler was falling through on newly
installed and run setups, where none of the files would exist, so the
last one would return a nil NSURL and attempt to add it to the playlist.

Fix this to check for the existence of the file before attempting to
open it. It shouldn't really exist anyway, unless someone really started
with a really old version somehow, and migrated it to the sandbox folder
proper.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 01:26:06 -07:00
Christopher Snowhill
04e40a8370 Chore: Update file type associations in Info.plist
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Some removed types and new types for VGMStream, and some new types for
libOpenMPT.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 01:03:55 -07:00
Christopher Snowhill
fabaa3f561 Sentry: Update sentry-cocoa to version 8.52.1
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 00:55:17 -07:00
Christopher Snowhill
7fe95980d7 VGMStream: Updated libvgmstream code base
Updated VGMStream to r2023-16-gb2fc214a

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 00:54:38 -07:00
Christopher Snowhill
bc8538cdd4 Updated libOpenMPT to version 0.8.0
And reordered all the source files in the projects according to name
sort. And removed all the deleted files, including some which were
forgotten in previous updates, but left as 0 byte files. Finally,
updated the project to use C23 / C++23 language standards.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 00:54:33 -07:00
Christopher Snowhill
dd55d4a9e1 Spot removal
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-06-06 00:54:27 -07:00
Christopher Snowhill
1a0ea3b5d3 Emergency Bug Fix: Fix loading individual tracks
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
And folders of tracks, too! The only thing that worked in 3117 was
playlist files. Hah!

Fixes #436

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-11 05:33:00 -07:00
Christopher Snowhill
7839f661a1 Sentry: Update sentry-cocoa to version 8.50.1
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-10 00:40:24 -07:00
Christopher Snowhill
30db270af3 VGMStream: Updated libvgmstream code base
Updated VGMStream to r1980-277-g72cb4b89

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-09 21:13:34 -07:00
Christopher Snowhill
ab7c0a0afd Track loading: Change file import and sorting
Files are now loaded to unique keys, and containers such as playlists
and CUE sheets maintain their file order. Deduplication now only applies
to top level files and not playlist contents. Sorting applies to top
level files, and playlist or container names, but not their contents.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-09 21:13:28 -07:00
Christopher Snowhill
69533e12c7 VGMStream: Updated libvgmstream code base
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Updated VGMStream to r1980-268-gc32951e9

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-03 01:56:34 -07:00
Christopher Snowhill
048bc7c30d Converter Node: Change volume scale observer
This should fix an exception being thrown because the observer wasn't
registered, or known to be registered. Only register it when it will be
used, and only unregister it if it was registered.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-05-03 01:56:29 -07:00
Christopher Snowhill
5753c48245 HDCD: Stop dynamically halving the volume
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Apparently, this doesn't work too well with real HDCD tracks, and causes
all sorts of weird volume issues. Just leave the volume alone, and let
HDCD decoding make tracks louder, possibly, rather than try to halve the
volume automatically on a detector that isn't terribly good.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-24 14:55:33 -07:00
Christopher Snowhill
3b4313d844 HDCD: Fix how unsigned audio may be processed
Unsigned will alter the input, so move it like the other integer sample
processors do.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-24 14:55:29 -07:00
Christopher Snowhill
a92973c6aa HDCD: Make HDCD extension processing optional
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
And disabled by default, at that. I can't actually hear the difference
of Peak Extension in the Rock track I have that claims to use it. And
Low Level Range Extension is more trouble than it's worth on tracks that
use it by mistake, or maliciously, if the case may be. I may add track
tag level control in the future.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-23 21:44:06 -07:00
Christopher Snowhill
91c4ed0c98 Maintenance: Touched by Xcode
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-23 21:44:01 -07:00
Christopher Snowhill
9e889399ec VGMStream: Fix memory leak
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Thanks to upstream VGMStream for fixing this in the Audacious plugin,
which I derived this code from in the first place, which explains the
memory leak getting in.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-20 21:35:27 -07:00
Christopher Snowhill
47a749ace0 VGMStream: Add native support for 24/32 bps int
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-20 21:35:23 -07:00
Christopher Snowhill
4232fb3949 VGMStream: Updated libvgmstream code base
Updated VGMStream to r1980-242-gfccbb05f

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-20 21:35:18 -07:00
Christopher Snowhill
f96cfea2d3 Placeholder commit for Sparkle update
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-20 21:03:54 -07:00
Christopher Snowhill
1cd431019c Updated MASShortcut to fix crashes
I hope this works to fix the crashes from migration.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-20 21:00:58 -07:00
Christopher Snowhill
3f0c8d379a Path Suggester: Make font fixed size
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-07 14:14:49 -07:00
Christopher Snowhill
72608ecea0 Path Suggester: Touched by Xcode
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-04-07 14:14:42 -07:00
Christopher Snowhill
ac26a28f59 Bug Fix: Fix FFmpeg reporting timestamps for DSD
Some checks failed
Check if Cog buildable / Build Universal Cog.app (push) Has been cancelled
Raw DSD is counting frames in bytes, not bits/samples, so it needs to be
scaled up when dividing by the raw sample rate.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-03-28 20:26:36 -07:00
Christopher Snowhill
a19469325b MIDI: Add unstable configuration for AU players
Some checks are pending
Check if Cog buildable / Build Universal Cog.app (push) Waiting to run
It's regarded as unstable as some plugins randomly decide to overflow
the main thread queue and crash the player on the main thread check, but
only sometimes, and not always.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-03-28 16:18:51 -07:00
Christopher Snowhill
f4a382c67f Sandbox Security: Disable library validation
Apparently, this was preventing some signed plugins from being loaded
into the process, preventing their use as MIDI plugins. And this may be
needed for future AudioUnit DSP filter support, for third party plugins
there, as well.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-03-28 16:18:46 -07:00
Christopher Snowhill
25cd57a3cb MIDI: Move sample buffer from stack to class
Move the stack-based buffer, which is rather large, to the player class
instance, where it will be allocated on the heap.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-03-28 16:18:42 -07:00
Christopher Snowhill
40d9574015 MIDI: Fix Audio Unit player in several ways
Improve rendering functions of Audio Unit player, and also fix looping
for the Audio Unit player, and any other possible future players which
use blocked decoding with timestamped events.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2025-03-28 16:18:37 -07:00