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>
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>
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>
Now using Accelerate methods to calculate and multiply ramps per channel
and add the remainder if necessary.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This code did not check the number of samples in a packet before adding
it to the output buffer, which apparently had the potential to cause the
output code to emit up to 512 samples of silence between tracks. This,
as one can guess, is a bad thing, and causes noticeable gapping between
tracks.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Output logging, a debugging feature that is only enabled at build time
if I need to chase down some audio mixing or output bug, was not logging
anything at all. Change to use Cocoa file writing methods, and actually
implement the output writer function again.
This code is left disabled 99% of the time anyway, and especially in
release builds. Like the node logging code elsewhere, it has the
potential to be very noisy and consume massive amounts of disk space.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This should be included, for safety purposes, in case the rounding up to
the nearest multiple of 256 samples doesn't bump the buffer size enough.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The double members should be ordered first so they are aligned to an 8
byte boundary. The rest are fine as-is.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Visualization Manager PCM/FFT copy function was already observing
these parameters for null input and only returning output to the ones
which were not null. This just makes it clear that they are both
optional parameters. This is useful for future visualization adventures,
allowing PCM copy without invoking the FFT processing, or requesting FFT
without also having to keep the PCM.
This is mostly only a compile time change, and has no noticeable effect
on the current runtime behavior, as the only consumers of the Visualizer
data currently request both PCM and FFT.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This affects User Defaults, but only has any effect on ChunkLists which
are being used for conversion, and only if they're processing DSD source
material. Thus, the observer should only be added on the one stream that
is converting DSD, and should definitely be removed when the object is
deallocated.
This fixes a serious crash bug that mostly appears to only affect Intel
Macs, and has no major side effects on Apple Silicon that I can tell.
It's a good thing I still own an Intel Mac or two to test on, even if
they are both trapped on older releases of macOS.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apparently I somehow didn't notice this situation because I still had
Rubber Band enabled, and existing users kept it enabled ever since I
introduced it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move this commonly used string decoding helper to the CogAudio framework
and import it in every plugin that uses it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apparently, stringWithUTF8String: just returns nil when the encoding is
not UTF-8, rather than throwing an exception.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The converter doesn't just require an output format call, it also
requires this input format change callback to actually signal it to
reopen the converter process with a new format setup.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Output format mostly requires stopping and restarting the output device,
and this also prevents us from using the latency function properly,
which apparently always returns 0 for output devices anyway. These
changes also prevent the output callback from hanging when resets occur.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fix default output device logging, and also the preferences if no
default device happens to be set.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fixes visualization latency under virtual machines, at least. Not sure
which local or native systems would be reporting high latency here, but
this should fix them as well.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Move the DSPs to the output node, so they don't get closed and reopened
across each file. Also restructure the output handler to buffer a little
on its own, to account for track switch activity.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The filter uses a pre-buffer of input audio, so extrapolate from the
actual input to fill the buffer. Fixes clicking on non-zero-crossing
track endings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Buffers were being treated as empty before they were actually processed,
due to races between the current node's end of stream marker and
actually feeding the output buffer.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This optional code, disabled at compile time by default, allows finding
weird issues with the sample decoding chain.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Hopefully this works for most ASCII and UTF-8 tags, and continues to
work for weird tag encodings.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Apparently, this isn't needed, and on two users reporting crashes,
actually causes exceptions to be thrown somewhere.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This required some minor workarounds to deal with the play time counting
that works toward play count reporting.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This was attempting to retrieve the NSURL host object, possibly on a
file URL where the two did not match a previous check. Now we only pass
the full scheme/host/path check if both URLs are not file URLs.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
There is a race condition with the next Node in the chain and the End of
Stream marker, considering how tiny the buffering is for these DSPs. Set
End of Stream instead after inserting the end of stream flush chunk.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>