This is useful because MA_ASSERT is only defined in the implementation
section of miniaudio.h which can cause issues when people copy/paste
the code and use it in a file that does not have visibility of the
implementation.
Note that there are still more references to implementation-defined
macros, but these have been moved to the public section in the dev-0.12
branch so I'm not bothering to change those just yet.
Public issue https://github.com/mackron/miniaudio/issues/787
This makes ma_decoder_read_pcm_frames() consistent with other data
sources. It now returns a result code and outputs the number of frames
read via an output parameter.
This removes the two separate callbacks for sending and receiving data
to/from the device to a unified callback that's used for both input and
output. The new callback takes a pointer to both an input and output
buffer. When the device is opened in playback mode the input pointer
will be set to null. Likewise the output pointer will be set to null
for capture devices. Both input and output pointers will be non-null
for full-duplex devices.
Rationale:
1) It allows the callbacks to be set at initialization time which feels
a bit more intuitive to me.
2) It avoids the need to call mal_device_set_send_callback(), etc.
3) It's a bit more consistent with the onLog callback. Previously,
onLog would be passed to mal_device_init(), whereas onSend, etc were
set with mal_device_set_send_callback(), etc. which feels needlessly
inconsistent.
Rationale:
1) The number of parameters is just getting too much.
2) It makes it a bit easier to add new configuration properties in the
future. In particular, there's a chance there will be support added
for backend-specific properties.