Re: [AD] set_volume() is evil

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


> Suppose you're playing an Allegro game under Linux console: how do you
> modify the sound volume if it is too low ? You switch to another console,
> log in again, then try to hook the OSS driver ?

Re Linux, I shan't answer the specific question because I don't have enough 
experience with Linux console. All I shall do is state that ALL programs seem 
to modify the global system volume (XMMS and MPlayer interfere with each 
other, and affect the volume of the sound effects I configured in X-Chat - 
all this is very annoying when I play a DVD, which tends to be quiet, and 
suddenly X-Chat makes a really loud noise and breaks the windows...). So 
maybe Allegro doing that wouldn't be such a concern, until the volume 
situation in Linux is fixed (and maybe it has been since I got this distro).

I daresay I'm talking about OSS above, but I haven't looked into it.

> However I guess your proposition makes more sense with windowing systems
> (Windows, BeOS, QNX, KDE) where you are always only two keystrokes away
> from the global sound mixer.

Windows is the target I was especially thinking of.

> Now the problem is that we would lose a functionality if we implemented
> this behaviour: someone might really want to control the real volume of his
> speakers without switching back and forth from his fullscreen application.
>
> So I think we could try to have both functionalities:
> - set_volume() with a more complete documentation explaining its drawbacks,
> - set_local_volume() which doesn't touch the global mixer.

Or what Bob suggested in a later post, which I prefer. Very few people will 
have used set_volume() with the intention of controlling the global volume, 
and those few can fix it quite easily.

On the other hand, if we go with your suggestion, MANY MANY people will 
continue to use set_volume(), intending to control only the volume of their 
program. People Don't Read Docs.

Let's finally note that the 'hardware mixer' part of set_volume()'s 
specification came from DOS days, when it was perfectly reasonable to set the 
global volume because no other programs would be running. (Well, you might be 
playing an audio CD, but Allegro doesn't set the global-global volume, only 
the digital global volume.)

> How do you see then the relationship between set_local_volume() and
> voice_set_volume() ?

Games typically use many voices, and create them from many different parts of 
the program. It's tiresome to retrofit volume scaling code to every one, when 
the program is advanced. Allegro will do this volume scaling for the user.

Ben



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