Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DoAdjustGain(void)
- {
- /**********************************************************/
- /******************* to do ********************************/
- // you have to control the volume variables (left and right) and mute
- // are in their range and adjust the sound card sound using the 'AdjustLevel' function:
- // parameters (channel left value = 1, channel right value = 0)
- //
- : You have to check that volume variables value is between minimum
- maximum value [0,255]. We can simulate a Mute with
- // right and left channel to 0;
- /***********************************************************/
- // Si no está muteado...
- if (MasterMute == 0) {
- // Volumen del canal izquierdo
- if (LeftVolume < VolumeMin)
- LeftVolume = 0;
- else if (LeftVolume > VolumeMax)
- LeftVolume = 255;
- // Volumen del canal derecho
- if (RightVolume < VolumeMin)
- RightVolume = 0;
- else if (RightVolume > VolumeMax)
- RightVolume = 255;
- // Ajuste del canal izquierdo
- AdjustLevel(0, LeftVolume);
- // Ajuste del canal derecho
- AdjustLevel(1, RightVolume);
- // Si está muteado...
- }else{
- // Ajuste del canal izquierdo
- AdjustLevel(0, VolumeMin);
- // Ajuste del canal derecho
- AdjustLevel(1, VolumeMin);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement