RE: [AD] install_sound(), DOS port, perhaps others?

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


> > honestly don't know how this would fit in with drivers that
> don't use the
> > Allegro mixer (such as the Windows DIGI_DIRECTX(n) driver, as opposed to
> > DIGI_DIRECTAMX(n)).
>
> The idea I had for that was similar, provide a method to use the primary
> sound buffer, again if this functionality is not already provided...

No, it isn't. Would you be willing to provide it? ;-)

I suggest you implement a polling system. Create a function which, when
called, sets a flag in mixer.c. This flag must be locked in memory (search
for the other LOCK_* macros in mixer.c). Then program _mix_some_samples() so
that, if this flag is set, it sets a pointer to point to the sample buffer.
The pointer should be initialised to NULL and locked in memory. Finally
create a pair of functions, in the style of get- and
free_audio_stream_buffer(); the first provides the pointer and a buffer
size, and the second resets the pointer to zero. These functions need not be
locked, since they are not called during an interrupt. (You'd only really
need one function to do both operations, but the system might need modifying
in the future, so it's as well to provide both.)

That's just one way of doing it. You or someone else may have a better idea
:-)

BTW please just e-mail the list, otherwise I receive two copies ;-)

Ben Davis



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