Re: [AD] get volume

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


The patch attached adds two new API calls:
void get_volume(int *digi_volume, int *midi_volume)
void get_hardware_volume(int *digi_volume, int *midi_volume)
 
Currently, drivers fully supporting this are:
DIGI_BEOS and MIDI_BEOS (completly untested but should be fine),
DIGI_ALSA(ver 9), DIGI_OSS, MIDI_OSS, DIGI_WAVOUTID, DIGI_DIRECTX, MIDI_WIN32
and MIDI_WIN32MAPPER. Didn't even bother to implement get_hardware_volume where
set_hardware_volume wasn't available.
 
DIGI_DIRECTAMX is implemented but I couldn't really figure out how does volume
control work there, so it's untested.
 
Note that get_hardware_volume usually won't return the same value passed to
set_hardware_volume because of different granularity and ratio between allegro
volume scale and driver's one. But will be close enough. Also, most of the
drivers set the volume at maximum in driver initialization so it blows away my
idea of "getting sound volume without altering".
 
Added NULL vtable entries to all remaining drivers (hope I didn't miss any) and
docs.
 
The patch also includes a fix in wdsinput.c. Compiler was warning about it.
Untested but should do.


-- 
Milan Mimica
http://sparklet.sf.net

Attachment: al_get_volume.diff
Description: Binary data



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