Commit Graph

3259 Commits (54b102f09e94aa22d2e398bce96ba7552390b25f)

Author SHA1 Message Date
Christopher Snowhill fce0e129a5 Spectrum Visualization: Replaced spectrum view
Introduced a brand new spectrum view based on SceneKit, with a scene
created by @kddlb and then altered by me to add the peak spheres. This
new scene should be lighter on display resources, even though it's fully
3D instead of a vector 2D scene done in Cocoa drawing primitives.

Co-authored-by: Kevin Lopez Brante <kevin@kddlb.cl>
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 00:03:52 -07:00
Christopher Snowhill bf54c45242 Info.plist: Updated with new file types
Updated with new file types added by VGMStream.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-02 15:00:39 -07:00
Christopher Snowhill ace62005db Updated VGMStream to r1745-4-g9ef1030d
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-02 14:58:25 -07:00
Christopher Snowhill 2aa3ddd545 Icon: Replace icon with a newly rendered design
Icon has now been replaced with a newly rendered design, and code
changed accordingly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-02 14:35:09 -07:00
Christopher Snowhill 5a47021f6d MAD Input: Fix gapless decoding of FFmpeg files
FFmpeg processed files may also contain the LAME tag magic of 'Lavf' or
'Lavc', not just 'LAME'. Missed this when I was maintaining the FFmpeg
code that handles this, or at least adding iTunes support to it.

Fixes #250 again.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-25 13:19:12 -07:00
Christopher Snowhill 2995f67c56 Updated VGMStream to r1721-52-g4eb40f00
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-21 14:29:41 -07:00
Christopher Snowhill 6a9b37f91e Info.plist: Update bundle properties
Update includes turning on system generated icons for all file types,
as well as adding several new file types from VGMStream that I missed
the last time around. Also includes some new fields that Xcode added in.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-21 14:24:05 -07:00
Christopher Snowhill 136200e963 Info.plist generator: Update with default icons
Update the Info.plist generator to emit file type definitions which use
system generated icons in place of the legacy icons in the app bundle.
Also include the new LSHandlerRank field. And also add a definition for
the scripting definition, which I accidentally added to the Info.plist
manually when I fixed scripting.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-21 14:22:43 -07:00
Christopher Snowhill c6c76c696d FFmpeg Input: Change Monkey's Audio description
Apparently, Info.plist, as generated by Xcode, is perfectly fine with
raw apostrophes in the source code, and doesn't require it to be an XML
entity.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-21 14:20:35 -07:00
Christopher Snowhill 94f915b892 VGMStream Input: Fix subsong files dumping tracks
Fixed an issue with individual files that reference single subsongs
inadvertently dumping all tracks in the referenced bank to the playlist,
instead of only adding the one bookmark or txtp file. Now it matches the
behavior of foobar2000.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-20 01:50:44 -07:00
Christopher Snowhill d1c6950ec6 MAD Input: Further gapless decoding and seek fixes
This time, a two-fer. First, ensure that file start seeking still skips
over the Xing/LAME header packet properly. Then, ensure that decoding
the last desired packet of the file does not indicate having decoded
more sample data than desired, which may have caused errors when
resuming playback position on restart and then smoothly transitioning to
the next track.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-19 23:56:17 -07:00
Christopher Snowhill 54f6702fb2 Updated VGMStream to r1721-48-g9d47eded
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-19 23:29:21 -07:00
Christopher Snowhill 299cc5a406 MAD Input: Possible further fix for seeking
This is a possible fix for another gap issue I experienced, and may be
exposed by seeking from the start of the file without decoding first.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-19 23:19:52 -07:00
Christopher Snowhill 36d2d7b7e0 MAD Input: Fixed gapless handling on file start
This error was caused by the necessary fix of the previous commit, only
it caused something completely different. Due to the fact that MP3 is
included in the list of formats supported for embedded CUE Sheets, the
open stage performs a seek to the file start after opening the file,
even if there is no sheet embedded. And the resulting seek was supposed
to be a null operation, since the file was already at the start. But, as
a result, this reset the start skip counter to zero, and because the
offset wasn't backwards, but to the same position, it didn't reset the
skip counter to the start of track delay. So, as a result, start of
track delay wasn't being removed, introducing a gap. Now, this change
bypasses the seek function altogether if seeking would do nothing from
the current playback position. Whew.

Fixes #250 and MP3 gaplessness in general, surprised I didn't notice
this sooner myself, but I guess I didn't bother to verify whether my
change would break anything. Whoops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-19 22:57:21 -07:00
Christopher Snowhill 2ed463034f MAD Input: Fix seeking backwards and in general
A backwards comparison led to seeking forward doing a full seek up from
the file start, and seeking backwards being a non-functional operation,
so the file would just continue playing as if there were no seek.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-04-01 19:34:54 -07:00
Christopher Snowhill 69ebce32c0 Revert "VGMStream Input: Remove downmixing, add layout"
This reverts commit 0d4ee4c901.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-21 16:34:49 -07:00
Christopher Snowhill 38969cd3b1 Updated VGMStream to r1702-86-gb1acf343
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-14 04:39:00 -07:00
Christopher Snowhill 3815ba0baf libOpenMPT Legacy: Updated to version 0.5.17
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-14 04:35:36 -07:00
Christopher Snowhill aa28b2beb1 libOpenMPT: Updated to version 0.6.2
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-14 04:34:25 -07:00
Christopher Snowhill 8abbf267e1 Highly Complete / USF: Fix playback for some USFs
The code now requires a variable to be set if Display Lists are to be
skipped by setting display processor interrupt as the bypass code is
supposed to. Also handle unsupported Ucode by calling the low level RSP
emulator instead.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-09 20:55:15 -08:00
Christopher Snowhill efadd1d012 Changed add files to observe playlist settings
Reverted 7f3da31b45, and reverted a past
commit of some sort. Now adding URLs and opening files from the Open...
option will obey the preferences for playlist adding, including modifier
keys, if used.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-08 00:04:14 -08:00
Christopher Snowhill 8cdbc28455 Core Audio Output: Add extra safety checks
Add safety check to check if a device is actually alive when enumerating
it, and also add nil pointer checks for the device name before trying to
CFRelease it. Fixes a rare crash on device add/remove cycle, such as
Bluetooth headphones.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-08 00:00:34 -08:00
Christopher Snowhill 9a0c598cf1 MAD Decoder: Correct length of iTunes MP3 files
The total frames count in the iTunSMPB header is the encoded length, so
add the start and end padding to it for the decoder implementation,
which expects this variable to contain the total decodable length
including the start and end padding. Fixes gapless decoding of iTunes
files.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-07 23:59:14 -08:00
Christopher Snowhill 183a03657d VGMStream Decoder: Fix mutable dictionary
This dictionary was replaced with an inline literal declaration, but
this defines an immutable dictionary. Change it to a mutable copy.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-06 03:57:03 -08:00
Christopher Snowhill ab8154348e Hively Replayer: Fix undefined behavior
Shifting negative numbers to the left is undefined behavior, so replace
with a multiply operation instead.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-06 03:53:28 -08:00
Christopher Snowhill 014f136b7e Visualization: Protect against out of bounds read
The analyzer was reading out of bounds, so guard against that.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-06 03:51:25 -08:00
Christopher Snowhill 26966c46a2 Cog Audio: Sanitize search paths
Remove references to previously used libraries from search paths.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-06 03:50:01 -08:00
Christopher Snowhill 6741151423 Highly Complete / USF: Enable HLE again
Enable HLE processing for USF playback, based on previous commit filling
out the HLE operations list. It should be safe to enable it again now.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-05 20:44:41 -08:00
Christopher Snowhill d570cf346d Highly Complete / USF: Preliminary overload HLE
Include preliminary overload effect for MP3 and CBFD HLE operations,
based on a pull request from upstream. This should make the HLE pretty
much sound for general use once again.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-05 20:43:41 -08:00
Christopher Snowhill 5622e92899 Resampler: Fix gapless output
The resampler wasn't being given enough room to flush its final output,
so a function was added to determine the current output latency, and
more sample data is requested, allowing the full output flush to occur.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-05 20:40:18 -08:00
Christopher Snowhill 6dccaa4d7f Fixes starting playback on short files
These two changes fix playback issues with either starting in the middle
of the playlist on a really short file terminating immediately instead
of queueing more files (InputNode.m), and issues with starting playback
at all on the end of a playlist on a short file. (OutputCoreAudio.m)

Fixes #246

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-05 15:53:47 -08:00
Christopher Snowhill 7c5cec1eb7 Amend r8bstate definition with extra safety
Just in case anything using the implementation ever needs to request
less sample data than would be returned by the resampler, it should be
able to return a remainder and keep extra remaining samples, if any.
However, the way Cog currently uses it, it would not be likely to run
into this scenario.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-05 15:23:21 -08:00
Christopher Snowhill ed0f7d81ab Various fixes for R8Brain resampler wrapper
Fixes to the resampler wrapper, such that it will survive some close
encounters with the edge of the buffer, if necessary. Also so it will
obey the buffer size limit for the output buffer.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 20:44:36 -08:00
Christopher Snowhill e1fa8d1e9b Clarified my hopefully not too stupid position
Sorry about that, everyone. I didn't mean to make it look like I
was freezing out my audience by assuming a portion of them support
the every move of their government.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 18:52:03 -08:00
Christopher Snowhill 18121a0a5a Forked R8Brain repository
The lineage of this library was not as obvious to me as it should have
been, considering the country of origin. While the developer has not
publicly stated their position on the invasion of Ukraine, they seem to
be in the anti-vaccine camp, which is disappointing to say the least.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 18:08:26 -08:00
Christopher Snowhill fe4af170ef Add R8Brain to the credits and readme
Added the R8Brain notice to the credits html document, and added a link
to the Github repository to the README.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 14:19:27 -08:00
Christopher Snowhill c9ed4bc678 Rename a variable to be more correct
This rename is more in line with what R8Brain does in its example code.
No actual behavioral changes to the code, however.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 14:18:23 -08:00
Christopher Snowhill 7f7e17a410 Correct capitalization of WavPack in codec info
Report the correct codec name for WavPack files. An info refresh will be
needed for it to take effect on existing playlist entries.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 02:08:55 -08:00
Christopher Snowhill 777ab28d6a Replaced libsoxr with r8brain free source
Replaced the free SoX resampler with the r8brain resampler source, which
is also free.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-03-04 02:07:38 -08:00
Christopher Snowhill c8d8e759bc Add autoreleasepool to cache thread
The cache thread should have an autoreleasepool around the release loop,
because it will be freeing Objective C objects periodically.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 23:30:18 -08:00
Christopher Snowhill da4630f4c5 Add a metadata loader cache
Promote the Plugin Controller source file to Objective-C++, and add a
simple data cache that holds on to requests for up to 5 seconds after
their last access, for preventing spammed requests from hitting files
over and over. This is apparently really relevant to the CUESheet reader
and its embedded CUESheet handling, as that tends to reread the same
file over and over as it populates the playlist with tracks. The nested
reader can also lead to repeated reading even on files without CUESheets
embedded.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 23:24:32 -08:00
Christopher Snowhill b3247578ed MAD Decoder: Comment out unused variable
A variable wasn't being used, except in debug builds. Comment out its
use and only skip over the field in the LAME header.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 20:52:35 -08:00
Christopher Snowhill 1dffaae990 Tweak libsoxr for Apple Silicon again
This should improve performance slightly again, as there were some ARM
code paths that weren't being enabled for ARM64.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 20:51:30 -08:00
Christopher Snowhill a978dfbf5a MAD Decoder: Fix MP3 decoding crash
There was a stupid bug in the previous commit I made, which caused local
or seekable MP3 files to crash the player on decode. This fixes that, by
checking that a packet has actually been decoded before touching the
packet info structures. Dumb, dumb, dumb error on my part.

Fixes #244

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 04:26:12 -08:00
Christopher Snowhill ca3dec4497 MAD Decoder: Support changing format
Support the weird scenario of format changes mid-stream. Probably
highly unlikely, and likely to break things if it does occur, but
whatever, it might actually happen in some weird file.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:43:54 -08:00
Christopher Snowhill 53209485c0 MAD Decoder: Correctly prepare buffer after free
The current buffer size argument is used to determine if a buffer should
be allocated on the next run. Just in case something reuses the same
decoder instance.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:38:17 -08:00
Christopher Snowhill 6b53a87784 Clean up a couple of warning notices on this file
There were several warnings due to the capitalization of the header
paths, and due to unused functions that are only required by the text
CUESheet parser, and we're only using the CUESheet generator, which has
been heavily modified to emit NSString output rather than a file on
disk.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:11:50 -08: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 2c0f04bbeb Possibly improve MAD sample conversion speed
No idea if this brings a noticeable improvement, but it probably makes
better sense to only do the division step one time instead of doing it
twice interleaved when processing stereo files, which are the most
common scenario anyway.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:08:55 -08:00
Christopher Snowhill 51e9648865 Improve libsoxr setup
Replace libsoxr dylib with a static library, and also build the two
architectures separately, to allow for platform-specific optimizations
to be employed for both. This also reduces the size of the CogAudio
framework by a few hundred kilobytes, as we eliminate unused code paths
better this way.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-26 01:07:20 -08:00