Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. void DoAdjustGain(void)
  2. {
  3. /**********************************************************/
  4. /******************* to do ********************************/
  5. // you have to control the volume variables (left and right) and mute
  6. // are in their range and adjust the sound card sound using the 'AdjustLevel' function:
  7. // parameters (channel left value = 1, channel right value = 0)
  8. //
  9. : You have to check that volume variables value is between minimum
  10. maximum value [0,255]. We can simulate a Mute with
  11. // right and left channel to 0;
  12. /***********************************************************/
  13.  
  14. // Si no está muteado...
  15. if (MasterMute == 0) {
  16.  
  17. // Volumen del canal izquierdo
  18. if (LeftVolume < VolumeMin)
  19. LeftVolume = 0;
  20. else if (LeftVolume > VolumeMax)
  21. LeftVolume = 255;
  22.  
  23. // Volumen del canal derecho
  24. if (RightVolume < VolumeMin)
  25. RightVolume = 0;
  26. else if (RightVolume > VolumeMax)
  27. RightVolume = 255;
  28.  
  29. // Ajuste del canal izquierdo
  30. AdjustLevel(0, LeftVolume);
  31.  
  32. // Ajuste del canal derecho
  33. AdjustLevel(1, RightVolume);
  34.  
  35. // Si está muteado...
  36. }else{
  37.  
  38. // Ajuste del canal izquierdo
  39. AdjustLevel(0, VolumeMin);
  40.  
  41. // Ajuste del canal derecho
  42. AdjustLevel(1, VolumeMin);
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement