Re: [AD] Audio plugin function names

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


On 27 Sep 2008, at 20:00, Peter Wang wrote:
Right now in the audio plugin, functions are named
al_sample_play, al_sample_stop, al_voice_destroy,
al_sample_data_destroy etc.
Shouldn't those be called al_play_sample, al_stop_sample,
al_destroy_voice, al_destroy_sample_data etc. to be consistent with
the rest of the API?

Yup.

If no one else has started doing this yet I can look into it during the week. I'll be moving as well, but hopefully I'll still have some time. So should that be al_play_sample or al_audio_play_sample? If no one expresses a clear preference I'll go with al_play_sample.

  Also need to get rid of, or hide away, most of the "audio
property" functions and replace them with specific functions for each
property. It's very hard to tell which properties apply to which audio
objects and which are read-only.

You mean the al_sample_get_float/long/pointer/enum etc. functions? I have to admit I didn't quite get those from a cursory look at the documentation.

That also brings me to a slight complaint that I have about the current audio system: it's a bit hard to do simple things. Most of the time I just want to load a sample from disk and play it when needed. To set things up to do that in Allegro 4 I would

- initialise audio subsystem
- load sample
- play sample

now judging from the examples it seems I have to

- initialise audio subsystem
- create voice
- create mixer
- attach mixer to voice
- load sample data
- create sample from sample data
- attach mixer to sample
- play sample

Steps two and three involve passing parameters that I have no real idea off what they do (I know, read the documentation) and I would be happy to go with a simple "pick whatever you think best, I don't care as long as it works".

I'm not saying that this greater level of control is bad (far from it) and obviously people do want it. But surely there has to be a way to make the simple case easier without compromising the more advanced features? For instance, a function that could combine steps 2, 3 and 4 and (more importantly) one that could combine 5 and 6? I don't know how that would work with freeing the different objects that get to point to eachother in the above chain.

Evert




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