Since I'm going back to work on monday I've decided not to sit idle on my
structural ideas. (Eat this Pizza!)
(PCM = Pulse Code Modulation, which means digital audio)
---------------------------------------------------------------------------
pcm_dev_format_s struc {rate, format, buffer_frag_size}
pcm_sample_format_s�struc {rate, format, bytesize}
---------------------------------------------------------------------------
pcm_dev_open(*pcm_dev_format_s) return handle
pcm_dev_close(handle)
?( pcm_dev_getformat(handle) return *pcm_dev_format_s )
pcm_sample_play(handle, *databuffer, *pcm_sample_format_s) return shandle
pcm_sample_stop(handle, shandle)
pcm_sample_getpos(handle, shandle) return int32
pcm_callback_buffersetup(handle, *make_buffer_function(*pcm_dev_format))
pcm_callback_stop(handle)
pcm_volume...?
---------------------------------------------------------------------------
Working examples:
KQ1 using using sound corresponding to the SoundBlaster option in DOS:
at startup: pcm_dev_format_s f = {44kHz, 16bit Stereo LE, 2048 bytes};
: h = pcm_dev_open(*f);
A squeeky door is about to open,
soundserver: pcm_sample_format_s sf = {resource[?], 8bit Mono,
resource[?]} ;
sh = pcm_sample_play(h, *resource[?], *sf);
Setting up OPL emulation,
oplout_pcmemu.c:
pcm_dev_format_s f = {44kHz, 16bit Stereo LE, 2048 bytes};
h = pcm_dev_open(*f);
pcm_callback_buffersetup(h, *calculate_virtual_opl);
Things noted: Only one callback_buffer thingy
top pcm device layer has to do mixing/conversion
ALSA rocks!
--
/Rickard Lind