Commit Graph

3274 Commits (636fefaf6f70b71bfe15ed387289e3ddf028596b)

Author SHA1 Message Date
Christopher Snowhill 872816f056 VGM Decoder: Change logic of dictionary creation
Metadata logic code should be using this dictionaryWithDictionary method
so that the resulting dictionary is actually immutable, like it claims
to be, rather than simply casting it. Safety coding, all that jazz. Not
really a major issue, just feels right.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-24 01:09:39 -07:00
Christopher Snowhill 8cf37cadf3 Unicode metadata: Change most logic to use guesser
Most file formats the player supports may or may not have UTF-8 safe
strings in their metadata. This should not be assumed to be UTF-8, and
when it is assumed, it results in nil NSString objects, which results in
inline initializers crashing due to uncaught exceptions.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-24 01:07:55 -07:00
Christopher Snowhill f7dc6beda1 Plugin utilities: Moved encoding guesser to header
Moved the string encoding guesser/converter to the Plugin.h header, so
it may be accessible from any plugin. I may make it a global member of
something eventually, but a static inline for such a simple function
should be fine for now.

This function facilitates converting arbitrary 8 bit encoded strings to
Unicode NSString objects. It should be used anywhere that UTF-8 is
expected, but not necessarily guaranteed, and where other 8-bit
encodings may also be supplied by a user's files.

Not using this setup for string inputs has already led to failed UTF-8
decoding resulting in nil NSStrings being passed to the inline array or
dictionary initializers, which results in crashes due to uncaught
exceptions.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-24 01:05:43 -07:00
Christopher Snowhill 4b2cf22800 [Visualization] Use OpenGL on legacy systems
On legacy OSes, and legacy GPUs, it should use OpenGL and not Metal,
otherwise there could be horrible performance, or even crashes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-23 17:21:13 -07:00
Christopher Snowhill c59d4d0215 [Visualization] Tear down window vis when not open
When the visualization window is not open, it should not continue to run
the scene until the app is quit. Apparently, the windowed mode is really
slow on old Intel machines, too. Full screening it is enough to bodge
the entire system session until the machine is remotely rebooted.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 18:39:32 -07:00
Christopher Snowhill 84eadd1f33 [Visualization] Use forced 3D mode in window
Windowed style should always use the perspective camera mode.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 17:45:51 -07:00
Christopher Snowhill 438634d6df [Visualization]: Change peaks to float on top
Change the peak sphere positions so they float on top of the bottom or
the bars, instead of clipping into them.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 17:25:21 -07:00
Christopher Snowhill f4712ad219 [Visualization]: Add Spectrum window
Add a dedicated spectrum visualization window, and add the necessary
hooks to start its event timer if playback is already running when it is
first opened.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 17:24:35 -07:00
Christopher Snowhill e2d7ebdec5 [Visualization] Enable anti-aliasing
Enable 8x multisampled anti-aliasing, to improve the appearance of the
spectrum on non-Retina/HiDPI displays. It can't really hurt on HiDPI,
either. Hopefully this won't cause it to use a whole load of GPU
resources, more than is reasonable.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 16:32:57 -07:00
Christopher Snowhill 79ac1e0dd6 [Visualization] Adjust Spectrum scene parameters
Disable color fringing and motion blurring, which were causing artifacts
with the transparent background.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 16:31:34 -07:00
Christopher Snowhill b99bc67bac
Merge pull request #256 from losnoco/nevack/spectrum-camera-mode-angles
[Visualizer] Adjust 2d projection camera angles.
2022-05-22 16:28:18 -07:00
Dzmitry Neviadomski a58b11dc90 [Visualizer] Adjust 2d projection camera angles. 2022-05-23 02:12:25 +03:00
Christopher Snowhill 4f1ea02359 README: Add directions for Git hooks path
Since we use a non-default path in the repository to store shared hooks,
it needs to be configured on a freshly cloned repository before it can
be usable.

Yeah, I forgot to follow my own directions before working on the project
for quite some time. The error crept in at the following commit:

2aa3ddd545 - Icon replacement, and team ID

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 16:12:12 -07:00
Christopher Snowhill 25906d1b2b Project file: Remove team ID that leaked in
I accidentally forgot to enable my hooks after cloning on a new macOS
installation.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 16:10:51 -07:00
Christopher Snowhill 4035ca861f Spectrum Visualizer: Add customization options
Add options to the Appearance preferences page to allow changing the
spectrum's projection between a 2D-like one and 3D perspective, and add
options to change the bar and peak dot colors.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-05-22 15:26:27 -07:00
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