Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Make these sounds what you want
- // vmbegin.wav
- // vmend.wav
- // voldown.wav
- // volup.wav
- // volmax.wav
- // volmin.wav
- // Then put them in the font folder or in a common folder and use Font Search paths functionality by
- // making your preset start like { "font;common",
- // Add these to the prop file with the others that look the same:
- EFFECT(volup); // for increse volume
- EFFECT(voldown); // for decrease volume
- EFFECT(volmin); // for minimum volume reached
- EFFECT(volmax); // for maximum volume reached
- // Replace the existing volume section with this:
- // SA22C Volume Menu
- void VolumeUp() {
- if (dynamic_mixer.get_volume() < VOLUME) {
- dynamic_mixer.set_volume(std::min<int>(VOLUME + VOLUME * 0.1,
- dynamic_mixer.get_volume() + VOLUME * 0.10));
- if (SFX_volup) {
- hybrid_font.PlayCommon(&SFX_volup);
- } else {
- beeper.Beep(0.5, 2000);
- }
- STDOUT.print("Volume Up - Current Volume: ");
- STDOUT.println(dynamic_mixer.get_volume());
- } else {
- // Cycle through Volume Menu option
- #ifdef VOLUME_MENU_CYCLE
- if (!max_vol_reached_) {
- if (SFX_volmax) {
- hybrid_font.PlayCommon(&SFX_volmax);
- } else {
- beeper.Beep(0.5, 3000);
- }
- STDOUT.print("Maximum Volume \n");
- max_vol_reached_ = true;
- } else {
- dynamic_mixer.set_volume(std::max<int>(VOLUME * 0.1,
- dynamic_mixer.get_volume() - VOLUME * 0.90));
- if (SFX_volmin) {
- hybrid_font.PlayCommon(&SFX_volmin);
- } else {
- beeper.Beep(0.5, 1000);
- }
- STDOUT.print("Minimum Volume \n");
- max_vol_reached_ = false;
- }
- #else
- if (SFX_volmax) {
- hybrid_font.PlayCommon(&SFX_volmax);
- } else {
- beeper.Beep(0.5, 3000);
- }
- STDOUT.print("Maximum Volume \n");
- #endif
- }
- }
- void VolumeDown() {
- if (dynamic_mixer.get_volume() > (0.10 * VOLUME)) {
- dynamic_mixer.set_volume(std::max<int>(VOLUME * 0.1,
- dynamic_mixer.get_volume() - VOLUME * 0.10));
- if (SFX_voldown) {
- hybrid_font.PlayCommon(&SFX_voldown);
- } else {
- beeper.Beep(0.5, 2000);
- }
- STDOUT.print("Volume Down - Current Volume: ");
- STDOUT.println(dynamic_mixer.get_volume());
- } else {
- #ifdef VOLUME_MENU_CYCLE
- if (!min_vol_reached_) {
- if (SFX_volmin) {
- hybrid_font.PlayCommon(&SFX_volmin);
- } else {
- beeper.Beep(0.5, 1000);
- }
- STDOUT.print("Minimum Volume \n");
- min_vol_reached_ = true;
- } else {
- dynamic_mixer.set_volume(VOLUME);
- if (SFX_volmax) {
- hybrid_font.PlayCommon(&SFX_volmax);
- } else {
- beeper.Beep(0.5, 3000);
- }
- STDOUT.print("Maximum Volume \n");
- min_vol_reached_ = false;
- }
- #else
- if (SFX_volmin) {
- hybrid_font.PlayCommon(&SFX_volmin);
- } else {
- beeper.Beep(0.5, 1000);
- }
- STDOUT.print("Minimum Volume \n");
- #endif
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment