Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust-audio-volume adjustments #6488

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Goober5000
Copy link
Contributor

Make some modifications to the adjust-audio-volume infrastructure:

  1. Add an aav_volume array for ease of access to all three volume variables. Refactor snd_adjust_audio_volume() to use this array to avoid duplicating code.
  2. Move update_looping_sound_volumes() to be handled in parallel with audiostream_set_volume_all(), and for the same reason: avoid setting the sound volume for every looping sound on every frame if the volume has not changed.
  3. If the volume is to be adjusted immediately, apply the relevant changes without waiting for snd_do_frame() to be called on the next frame. Resolves FR: Make mission volume levels at mission start smarter #6291.
  4. Fix some edge cases in adjust_volume_on_frame().

Make some modifications to the adjust-audio-volume infrastructure:
1. Add an `aav_volume` array for ease of access to all three volume variables.  Refactor `snd_adjust_audio_volume()` to use this array to avoid duplicating code.
2. Move `update_looping_sound_volumes()` to be handled in parallel with `audiostream_set_volume_all()`, and for the same reason: avoid setting the sound volume for every looping sound on every frame if the volume has not changed.
3. If the volume is to be adjusted immediately, apply the relevant changes without waiting for `snd_do_frame()` to be called on the next frame.  Resolves scp-fs2open#6291.
4. Fix some edge cases in `adjust_volume_on_frame()`.
@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. sound A feature or issue specific to music and sound labels Dec 25, 2024
@Goober5000 Goober5000 added this to the Release 25.0 milestone Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. sound A feature or issue specific to music and sound
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant