Re: [AD] Patch: Audio addon docs corrections

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 03/24/2016 04:20 AM, SiegeLord wrote:
Wow, thanks a lot! That looks great, committed as is.
Thanks.

I filed a bug about al_set_sample_instance_length, eventually we'll fix
it. It does seem like a useful function to have, but it needs to be
implemented properly (it's reminiscent of al_set_audio_stream_loop_secs)
except half as useful.

IMHO the name ..._length is a bit misleading, I think it's rather an endpoint. - Why not have something like

al_s/get_sample_instance_start_point
al_s/get_sample_instance_end_point

where al_set_sample_instance_length would become the latter? This would be more like al_set_audio_stream_loop_secs (as it would double the usefulness), but would also apply if not looping. Could be one function for both values as well.

There seems to be no check against the actual buffer length because it is overwritten by al_set_sample_instance_length, so it looks like an additional property is needed anyway.

By the way, there already is an internal field called "loop_start" in ALLEGRO_SAMPLE_INSTANCE, but it's never set to anything != 0 for sample instances (audio streams and mixers inherit from sample instances). There's also "loop_end" but it's set once to the ALLEGRO_SAMPLE's length in al_create_sample_instance resp. al_set_sample. Both of these loop_* properties are not exposed (for sample instances). IMVHO, it might be more "natural" to keep the length and alter/use those loop_... settings instead.

Kind regards,
Polybios




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/