Closed LAGonauta closed 6 years ago
It seems that libsndfile is too old on Ubuntu 14.04 to support cue points... I guess this PR will need to wait.
Now it should compile and work on older library versions, thanks kcat. I added an underline at the start of the type name to differentiate from the one from the library, if you believe there is a better naming scheme I will change to it.
Names starting with an underscore and uppercase letter (or double-underscore and lowercase letter) are reserved for the compiler. I don't imagine these would be too big of a deal (it's unlikely the compiler would need these specific names), but I would prefer them to not be in the sndfile.hpp
header. They'd be better off in the source, and if you're going to move them, perhaps the names can be changed too.
@kcat I moved to the source in a local scope, I hope this is enough.
I wanted to use the stream decoder to simulate "AL_EXT_loop_points" on drivers that does not support this extension, but I noticed there seems to be no way to set the decoder loop points manually from the application and the standard WAV decoder does not yet support reading the cue points from the files I am using (the cue points are at the end after the audio data).
As I would eventually want to decode OGG and FLAC files, I simply added loop point support to the built-in libsndfile decoder.
This PR also has a compiler fix that I had to use in another commit, however I couldn't test GCC yet to see if it can compile with this fix (or should I have cast "pos" to a "size_t" instead?).