NoSloppy

Untitled

Jan 10th, 2021
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1.  
  2. void ChangeVolume(bool up) {
  3. if (up) {
  4. STDOUT.println("Volume up");
  5. if (dynamic_mixer.get_volume() < VOLUME) {
  6. dynamic_mixer.set_volume(std::min<int>(VOLUME + VOLUME * 0.1,
  7. dynamic_mixer.get_volume() + VOLUME * 0.10));
  8. //beeper.Beep(0.5, 2000); // BC Custom Spoken Volume menu
  9. ::CommandParser::DoParse("play", "volchangeup.wav"); // BC Custom Spoken Volume menu
  10. STDOUT.print("Current Volume: ");
  11. STDOUT.println(dynamic_mixer.get_volume());
  12. }
  13. else {
  14. //beeper.Beep(0.5, 3000); // BC Custom Spoken Volume menu
  15. ::CommandParser::DoParse("play", "volmax.wav"); // BC Custom Spoken Volume menu
  16. }
  17. } else {
  18. STDOUT.println("Volume Down");
  19. if (dynamic_mixer.get_volume() > (0.10 * VOLUME)) {
  20. dynamic_mixer.set_volume(std::max<int>(VOLUME * 0.1,
  21. dynamic_mixer.get_volume() - VOLUME * 0.10));
  22. //beeper.Beep(0.5, 2000); // BC Custom Spoken Volume menu
  23. ::CommandParser::DoParse("play", "volchangedown.wav");// BC Custom Spoken Volume menu
  24. STDOUT.print("Current Volume: ");
  25. STDOUT.println(dynamic_mixer.get_volume());
  26. }
  27. else{
  28. //beeper.Beep(0.5, 1000); // BC Custom Spoken Volume menu
  29. ::CommandParser::DoParse("play", "volmin.wav"); // BC Custom Spoken Volume menu
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment