[futurebasic] Re: [FB] Speaker -- Default Output Volume

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2002 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Fri, 22 Feb 2002 02:22:06 +0100
tedd wrote:
> 
> Hi:
> 
> I read in an obviously dated book (Foundations of Mac Programming by
> Sydow), that one could find the current volume level for the sound
> control panel by using:
> 
> in C
> 
>      long theOrginalVol;
>      GetDefaultOutPutVolume( &theOriginalVol );
> 
> And, then to set the volume, one would use:
> 
> Again, in C
> 
>      long  theNewVolume = 0x04000400
>      SetDefaultOutputVolume( theNewVolume );
> 
> However, I find no:
> 
>    GetDefaultOutPutVolume( &theOriginalVol );
>    SetDefaultOutputVolume( theNewVolume );
> 
> similar FB functions.
> 
> Now, I know that I can use the Sound Manager and change the volume
> and channel (right and left) of what's being played via _ampCmd and
> _volumeCmd commands using param1 and param2, but that's not my
> question.
> 
> I want to know how to change the volume settings in the system sound
> control panel. This means that after doing such, the values that the
> user has set in the sound control panel will change.
> 
Tedd,

Just define the missing Toolbox calls:

Toolbox fn GetDefaultOutputVolume(long * level) = OSErr `0x203C,
0x022C, 0x0018, 0xA800
Toolbox fn SetDefaultOutputVolume(long level)  = OSErr  `0x203C,
0x0230, 0x0018, 0xA800



-- 

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------