Re: [AD] SF.net SVN: alleg:[12523] allegro/branches/4.9

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


On 2009-08-27, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> On Thu, 2009-08-27 at 11:46 +1000, Peter Wang wrote:
> > > > It's actually ALLEGRO_FILE.  Still want to change it?
> > > 
> > > to _file maybe?
> > 
> > I avoided that because al_load_<format>_file doesn't distinguish it much
> > from al_load_<format>.  _fh is fine to me.
> > 
> > [Really ALLEGRO_FILE should be ALLEGRO_STREAM, and ALLEGRO_STREAM should
> > be ALLEGRO_AUDIOSTREAM... but I'm NOT suggesting that because it affects
> > a lot of function names badly.]
> 
> Well, _fh is no better than _fp considering the parameter type is
> ALLEGRO_FILE. The al_load_*_entry name was from when ALLEGRO_ENTRY was
> actually used as file handle.
> 
> What about using just _f? If what we're doing is add some suffix without
> much meaning, then _f should be as good as _fp or _fh.

And _fp is as good as _f ;-)

> > > I also think we should rename these two at the same time:
> > > 
> > > al_stream_from_file -> al_stream_sample
> > > al_load_config_file -> al_load_ini
> > 
> > "Sample" suggests a short sound snippet to me.
> > al_stream_audio/al_stream_audio_file?
> 
> Maybe we should rename ALLEGRO_SAMPLE to ALLEGRO_AUDIO? When the
> documentation measures the length of "samples" in a unit of "samples",
> it doesn't really make sense right now.

That's the standard terminology, though, and I don't like the ALLEGRO_AUDIO
suggestion.  In the documentation we can say "sample values" when talking
about the units.


Actually, this seems okay to me:

    ALLEGRO_AUDIO_STREAM
    al_attach_audio_stream_to_voice
    al_attach_audio_stream_to_mixer
    al_create_audio_stream
    al_destroy_audio_stream
    al_get_audio_stream_event_source
    al_drain_audio_stream
    al_rewind_audio_stream
    al_get_audio_stream_frequency
    ...
    al_get_audio_stream_attached
    al_detach_audio_stream
    al_get_audio_stream_fragment
    al_set_audio_stream_fragment
    al_get_audio_stream_fragments
    al_get_available_audio_stream_fragments
    al_seek_audio_stream_secs
    al_get_audio_stream_position_secs
    al_get_audio_stream_length_secs
    al_set_audio_stream_loop_secs
    al_register_audio_stream_loader
    al_audio_stream_from_file
    al_load_audio_stream_wav

which follows in the footsteps of Allegro 4.  You might remove the
underscore between AUDIO_STREAM, though I don't have any justification.

Then we could use a _stream suffix, e.g.

    al_load_png_stream(ALLEGRO_FILE *stream, ...);

Peter




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