And this is the actual meat of getting it to work properly, the changes
the Swift code needed to actually be fully functional.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
These imports needed to be changed so that Swift bridging didn't import
the system's semaphore.h instead of CogAudio's Semaphore.h, which is a
completely different thing.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
There has been an API in GME to detect tracks ending for quite some time
now, and this just adds a little bit to the existing comment, which
previously noted that there was no way to detect if a track had ended,
which may have been true several major versions of GME long past.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The output has been assigning twice as many samples as it was supposed
to ever since commit 8d851e5bda, which
ended up generating the correct 1024 samples (2048 per GME parameter),
but assigned 2048 to the AudioChunk, which resulted in over-reading the
audio buffer, and thankfully not crashing, but instead causing an awful
sound distortion effect as random memory contents were played as PCM
audio.
Fixes#320
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Allow .mp3 and such to fall back to the FFmpeg container handler, in
case there are chapters in a renamed file.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The input isn't supposed to close its own sources, as it did not open
them itself, and they should be cleaned up automatically when they are
released to zero reference count.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Let the FFmpeg decoder handle RIFF files, if they happen to be named
.mp3 and not something like .wav.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This fixes the update URL and parameter handling. Seems there
was an extraneous newline returned by the security command.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Fixed RAD2 files referencing instruments not present in the
file, which caused the player to reference uninitialized memory
and usually crash.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The SID builder needs a static initializer, otherwise multiple instances
created simultaneously, such as during populating info on adding a lot
of tracks, will race and crash the player.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CUEs will now deduplicate playlist entries based on their dependencies,
and prevent loading redundant tracks if you add an entire directory, or
use the option to add a directory when adding single files from it.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The subdirectory parser, the CUEsheet reader, and the legacy XML
playlist reader were missing grants for Sandbox access.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Clarified the button name to "Open", which is what the button actually
says, not "OK". Also used double quotes around the other button name.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Clean up redundant paths automatically, and on startup. Also refresh the
preferences dialog path list every time it is opened.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Deduplicate loaded tracks, to prevent duplicate items when adding a
folder that happens to contain playlists or CUE sheets referencing the
very same files.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Newly added paths weren't adding all of the necessary data to the list
storage to make it possible to remove them without restarting the
player. Oops.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Added a warning dialog to notify the user of the purpose of the add
folder dialog that will pop up after it. Otherwise, they may get the
idea that the dialog is a glitch and should be cancelled.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Only ask permission for container folders if the container has local
files, and not for purely remote files, such as stream playlists.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Buffer up to 5 milliseconds of audio, or at minimum 1024 samples, each
call. Also pre-allocate the buffer, rather than using a stack buffer.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
This is an unnecessary step, and results in the offset being off by the
duration of the first pre-read block. This is incorrect.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Vorbis, Opus, MAD MPEG, and especially the FFmpeg inputs needed to
have their metadata update intervals severely reduced, to reduce CPU
usage, especially on files with lots of tags. Interval reduced to only
once per second.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Oops, this compare blunder resulted in DSD decimation breaking every
1024 samples or so, owing to block sizes, and caused ticking sounds as a
result. It would also cause HDCD decoding to break completely.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Neither of these two changes is really important, but they do simplify
things, and the division on that one function makes the non-decimating
DSD support actually functional, as the caller expects a specific number
of samples, and that was otherwise octupling the input sample count.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Another large stack buffer was at play here. Consolidated it into an
existing buffer that can perform double duty here, since neither place
it's used conflicts with each other.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
It already supported reading the CUESHEET metadata block, but I managed
to break reading and processing CUESHEET Vorbis comments, which broke
CUE tagging, as well as files that didn't have both tags.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>