Commit Graph

3293 Commits (9d559481d323e1ea96fe56ff2c16550df05c4172)

Author SHA1 Message Date
Christopher Snowhill 5c3050c0d3 Playlist loader store: Adopt more correct method
This is a more correct method of identifying the supported classes to
coalesce into unique pointers through the storage array. I completely
forgot about this method, oops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-17 03:01:34 -08:00
Christopher Snowhill 2a27435f7e Dictionary merge: Correctly drop empty data tags
This allows for TagLib to handle artwork reading where the file built-in
readers fail, such as the FFmpeg reader, which would require parsing the
stream data for artwork packets, a really wacky convention to have.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-17 03:00:35 -08:00
Christopher Snowhill 007ec3696d SQLite Store: Properly read strings into memory
Strings read from the database were not being stashed in the memory
store, which caused things like blank tags instead of correct metadata.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-17 02:58:57 -08:00
Christopher Snowhill 4f5e4eca36 Fix visualization for variable audio block sizes
IN A.D. 2101, WAR WAS BEGINNING. *boom*

Yeah, this was a dumb bug, I didn't realize that AUAudioUnit would just
arbitrarily ignore my configured block size and request a different one.

The AirPods Pro will just request 480 instead of the 512 I ask for, so
let's instead support variable block sizes, and only take up to the last
4096 samples of the chunk fed to the output device.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 21:54:55 -08:00
Christopher Snowhill 5611d08df1 Reduce memory usage of adding tracks
Significantly reduce the memory footprint of adding tracks to the
playlist, by coalescing the NSString and NSData objects in the info
dictionaries as they are being loaded in the background, into a common
data set which will then be discarded when the whole job is completed.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 21:38:43 -08:00
Christopher Snowhill d30746bffa Extend deduplication to loading artwork on open
When adding tracks, deduplicate their artwork when loading to memory.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 17:06:13 -08:00
Christopher Snowhill 3de43b55a7 Significantly reduce memory usage all around
Added a string dictionary for deduplication of metadata, and actually
initialize both it and the art dictionary on startup, so they actually
work like they should.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 16:57:47 -08:00
Christopher Snowhill c242d53200 Resume on restart: Only seek into seekable files
This allows streams to be resumed from the beginning when restarting.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 13:22:53 -08:00
Christopher Snowhill 7f3bf052ca Update supported file name extensions for art
Art read from external files supports more formats than previously
listed here. Amend the list accordingly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:56:34 -08:00
Christopher Snowhill b8057b7c29 Add support for AVIF album artwork
Import libavif and libaom, specifically built only for decoding, not
encoding.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:52:51 -08:00
Christopher Snowhill 8c945b53de HTTP Reader: Guess encoding type of stream info
Stream metadata could be in any encoding, not necessarily UTF-8. Handle
this in an appropriate way.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-16 01:51:16 -08:00
Christopher Snowhill 1ac1fe29c7 Implement new spectrum mode, toggled by left click
The new spectrum mode is linear frequency. Both modes also now have a
lower range of 10Hz, where possible.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 23:24:58 -08:00
Christopher Snowhill 6d052bc1ac Visualization: Increase temporal resolution
By reducing the window size, we have a more responsive visualization.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 23:22:47 -08:00
Christopher Snowhill 0d4ee4c901 VGMStream Input: Remove downmixing, add layout
Downmixing should no longer be necessary, unless someone actually tries
to emit up to 64 channels, while we support only 32 channels, but really
only 18 channels. Also read the channel layout field from the decoder,
so that the speaker layout will propagate from the files to the player.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:55:34 -08:00
Christopher Snowhill 8372ed4eea Fix equalizer applying presets in the background
The equalizer needs to apply its presets to the new settings variables
every time the preset changes, even when it happens with no dialog open.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:54:14 -08:00
Christopher Snowhill 4906c38827 Align all use of Accelerate vDSP functions
vDSP functions expect their input and output pointers to be aligned to
an even four values. Correct this by aligning all pointers. The
allocated buffers used for one parameter should already be aligned
somewhat, but align the incremented positions used on some of them so
that the vDSP functions don't misbehave. Also align the volume scaler
input by doing scalar math until the pointer is aligned prior to calling
vDSP_vsmul. Also, change 16-bit and 32-bit scale to use vsdiv instead of
vsmul with a really small number already divided into one.

Fixes the test vectors that were sent in extrapolating incorrectly due
to their final blocks having uneven sample counts, resulting in
unaligned pointers.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:53:09 -08:00
Christopher Snowhill 627aeda8b1 Set default volume to 75%
This doesn't fix an outstanding issue which will be fixed by the next
commit, but it does fulfill a request.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:49:26 -08:00
Christopher Snowhill 25077277b3 Add bad sample cleaner for debugging
A bad sample scanner and cleaner will point out in the log whenever a
bad sample, such as infinity, or Not a Number, or even huge values over
±2.0, in case some piece of code, or a decoder, or even a bad file, has
taken over the output.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:48:47 -08:00
Christopher Snowhill 51e8223078 Linear Predictor: Rearrange things somewhat
The original didn't really handle backwards versus forwards differently,
as far as the predictor coefficients should have been, as they probably
should have been reversed for a different direction window.

This didn't fix my problem, though, but did possibly expose something
else to mess with.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 22:41:18 -08:00
Christopher Snowhill 3274bc9fe7 Revert "HTTP Reader: Support more stream info"
This reverts commit 33388918b3.
2022-02-15 15:00:11 -08:00
Christopher Snowhill 96f2a382ee DSD gaplessness, part 3, mildly pointless
In the rare event that we're somehow playing decimated DSD at full
sample rate instead of resampling, only the start needs to be skipped,
and the end needs the input to the decimator padded to flush it, but
nothing needs to be truncated from the end of the output in that case.
Still, mostly pointless, since next to nobody will be outputting 384 kHz
from their Macs, in any case, much less unprocessed DSD.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 02:29:06 -08:00
Christopher Snowhill bec01b675a DSD gaplessness, part 2
We should be extrapolating right over top of the DSD decimator latency,
rather than in front of it. Yeah, that'll do.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 02:11:53 -08:00
Christopher Snowhill 4b0f6b381f Fix DSD gaplessness handling
DSD files should be properly gapless now.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 02:03:06 -08:00
Christopher Snowhill 570e28403e Redo x86_64 build of libFLAC
It needed to be built separately to enable the intrinsic
optimizations. Oops.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 01:11:58 -08:00
Christopher Snowhill 33388918b3 HTTP Reader: Support more stream info
For streams offering a three way split in their ICY metadata blocks,
support album/artist/title using that three way split. Otherwise do the
usual of artist/title, or blank artist if there's no hyphen to split on.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:57:22 -08:00
Christopher Snowhill 1b1769c5c2 Validate libraries once again
Remove the entitlement for disabling library validation, as this should
not be needed any more.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:47:31 -08:00
Christopher Snowhill 5e8f066a01 Add include path for libogg
The new libogg directory must be included for <ogg/ogg.h> in one place.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:40:47 -08:00
Christopher Snowhill 2036a92b23 Remove deleted file
This vorbisfile.h is no longer included in the project tree.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:40:15 -08:00
Christopher Snowhill df661dc466 Fix dynamic metadata in some cases
For some reason, this sometimes gets set to nil. Fix to refer to the
current track in that case.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:34:57 -08:00
Christopher Snowhill f071d3e90c Build several libraries out of tree now
Building libogg, libvorbis, libvorbisfile, libFLAC, libopus, and
libopusfile out of tree, to utilize their projects' CMake build scripts,
and also enable any platform optimizations that may have been missing.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-15 00:26:55 -08:00
Christopher Snowhill 52443066e7 Spectrum Visualizer: Fix frequency range, bands
Reduce the virtual resolution to match the actual resolution, and set
the analyzere frequency to Nyquist of the audio input, as it seems to
behave as if the entire range of the input FFT bands are up to the
specified frequency, rather than half of it. Otherwise, we lose half of
the frequency range provided by the input data.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 21:10:57 -08:00
Christopher Snowhill 934589ebdd FFmpeg: Enable AIFF support
The system AIFF reader seems unable to read some really old files, so
enable FFmpeg to do so instead.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 21:09:24 -08:00
Christopher Snowhill efea2e33d8 Equalizer: Correctly handle flatten vs. custom
Flatten EQ button should remember that the preset is set to "Flat", and
drawing on the equalizer or changing sliders should remember that the
preset is on "Custom".

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 20:19:03 -08:00
Christopher Snowhill b8a98e301e Metadata loading: Correctly merge over empty tags
Metadata versus properties merging, correctly merge over empty fields if
they are assigned with empty strings or zeroed numbers, instead of only
merging over completely missing fields.

Fixes emailed bug, CUE Sheet metadata reading, primarily.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 20:02:18 -08:00
Christopher Snowhill 67fcd2bb27 NSDictionary+Merge: Support overwriting empty
Support overwriting empty fields of NSNumber or NSString form with
values from the merging dictionary. Correctly overwrite the value from
the first dictionary with values from the second if the first contains
empty strings or zeroed numbers.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 19:55:20 -08:00
Christopher Snowhill a8c9f748c7 FLAC Input: Correctly prioritize text CUESheet tag
Prioritize "cuesheet" Vorbis tag over binary CUESheet tag, as the former
can contain metadata, while the latter cannot.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 19:54:08 -08:00
Christopher Snowhill 4a0690b3ab Spectrum Visualizer: Change border dimensions
This should make the border consistently sized.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 17:15:38 -08:00
Christopher Snowhill ec56725824 Equalizer: Disable tabbing, and remove HUD style
This should improve contrast significantly.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 17:15:09 -08:00
Christopher Snowhill 0c504d9330 Preferences: Fix alignment of some options
This hopefully handles #232 as best I can, for now.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 17:01:10 -08:00
Christopher Snowhill b9dde0deca Preferences: Fix dead/dupe remove buttons
For some reason, they were marked "navigational", because I accidentally
chose the Info inspector button as the button to dupe to create them in
the first place.

Fixes #237

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 16:59:25 -08:00
Christopher Snowhill f09022693a Preferences: Got rid of appcast selection
There is only one appcast to choose from, and it has been this way for
quite some time now, so simply make it final.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 16:58:03 -08:00
Christopher Snowhill a4ff2477be Equalizer: Various changes
Among the many:
- Spaced out the equalizer settings from the preamp slider
- Propery synchronize the bands' state with the stored settings
- Properly store the setting for Custom mode when drawing on the bands

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-14 16:46:32 -08:00
Christopher Snowhill 4a9e7baf7f Equalizer: Rename window
Oops. I'll push this change to my next release I have planned.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 23:54:02 -08:00
Christopher Snowhill 41efc22096 Equalizer: Bring it back to the quality it had
The quality of the equalizer dialog is now up to par with what we had
before, minus all the crashes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 23:37:58 -08:00
Christopher Snowhill 344ceb173d Visualization: Increased fft size, imported code
Boy, I just be outright stealing code now. But it looks nicer now.

Fixes #234

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 12:18:58 -08:00
Christopher Snowhill cad09b8912 CUE Reader: Fix enumerating sheets and tag reading
The reader should have been skipping the properties of CUE sheets when
reading the referenced data for the inner files.

Fixes #235

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 12:18:58 -08:00
Christopher Snowhill 7ef583340d Equalizer: Replace dialog with custom job
New custom equalizer dialog, painstakingly hand assembled.
2022-02-13 11:05:32 -08:00
Christopher Snowhill 8033256c4d Visualization: Fix customize toolbar
Spectrum item needs fixed size.

Fixes #230

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 02:56:39 -08:00
Christopher Snowhill f2bebdefa7 Visualization: Clear peaks on stop
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
2022-02-13 01:42:02 -08:00
Christopher Snowhill 992b716193 Visualization: Greatly improve spectrum design
Improvement includes greatly reducing the CPU usage by not using an
NSImage based painting system.

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