This is adding too much complexity, is less efficient than doing it
manually, and is not compatible with some future changes for supporting
effects that require multiple input streams.
This is a simplified and somewhat more intuitive way of handling fades.
With these APIs, fades are applied immediately, whereas with the old
fading APIs the fades were scheduled. The old APIs still exist, but may
be removed.
The ma_sound_set_fade_in_frames/milliseconds() API sets the fade which
will be applied immediately. If the starting volume is negative, the
fade will start from the current fade volume. This will also overwrite
any existing fade that is already happening.
The ma_sound_get_current_fade_volume() API allows you to retrieve the
current volume of the fade.
The fade is layered on top of the normal volume parameter. I.e. they
are configured and applied to the signal interdependently.
Currently, all fades are applied linearly.
This is happening because the data buffer is incorrectly being reported
as busy (still loading) which is used to indicate to the engine that no
data is available and therefore nothing can be played.
Previously you could set the group to NULL in which case the master
group would be used, but this has now changed and the group parameter
can never be NULL. Use ma_engine_get_master_sound_group() to retrieve
the master sound group.
* Removed ma_engine_sound_set_fade_in/out()
* Add ma_engine_sound_set_fade_point_in_frames()
* Add ma_engine_sound_set_fade_point_in_milliseconds()
* Add ma_engine_sound_set_stop_delay()
* Add ma_engine_sound_get_time_in_frames()
* Removed ma_engine_sound_group_set_fade_in/out()
* Add ma_engine_sound_group_set_fade_point_in_frames()
* Add ma_engine_sound_group_set_fade_point_in_milliseconds()
* Add ma_engine_sound_group_set_stop_delay()
* Add ma_engine_sound_group_get_time_in_frames()
The fade in/out system has been replaced with something more general
and flexible which allows for up to two fade points to be configured
per sound or group, with arbitrary time periods and volumes.
This commit also includes the addition of a placeholder parameter for
ma_engine_sound_init_from_file() which is used to notify the caller
when an asynchronously loaded sound has finished loading.