Skip to content

Conversation

@AdamTadeusz
Copy link
Contributor

@AdamTadeusz AdamTadeusz commented Jul 7, 2025

Description

Setting the volume of a music sound to 0 pauses that sound, thus muting in the mp3 player is notpossible in the traditional sense and instead the music is just turned down to the minimum possible value. This value changes depending on the value of snd_musicvolume, this PR uses a neat little workaround so that snd_musicvolume is ignored by sounds played through the mp3 player but the other advantages of the "#" sound character are still present.

Also I noticed the volume slider convar values were not being updated unless the slider that was currently affecting mp3 playback was moved (so changing the in game slider only when in the main menu and then quitting the game would not save that change), so I changed those values to be updated when the slider posts an action signal once the user stops dragging the slider

Toolchain

  • Windows MSVC VS2022
  • Linux GCC Distro Native [Specify distro + GCC version]
  • Linux GCC 10 Sniper 3.0

Linked Issues

  • fixes #
  • related #

@AdamTadeusz AdamTadeusz changed the title MP3 Player sounds don't use snd- MP3 Player sounds don't use snd_musicvolume Jul 7, 2025
@AdamTadeusz AdamTadeusz requested a review from a team July 8, 2025 09:34
Rainyan
Rainyan previously approved these changes Jul 8, 2025
@Rainyan Rainyan requested a review from a team July 8, 2025 21:55
@Masterkatze
Copy link
Contributor

Moving the sliders does update the cvars but not vice versa:

1

sunzenshen
sunzenshen previously approved these changes Jul 25, 2025
Copy link
Contributor

@sunzenshen sunzenshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, while it's kind of cursed that the sliders don't update live after the cvar cl_neo_radio_volume and cl_neo_radio_volume_ingame commands, I think trying to update the sliders might involve needing to poll the cvars, and at that point the patch might be worse than the bug.

Plus end user case of a player interacting with GUI sliders is not affected, so I think the main use case still works alright.

@AdamTadeusz AdamTadeusz dismissed stale reviews from sunzenshen and Rainyan via 2146c22 July 25, 2025 15:03
@AdamTadeusz
Copy link
Contributor Author

I added a change callback to the convars to set the slider values

sunzenshen
sunzenshen previously approved these changes Jul 27, 2025
Copy link
Contributor

@sunzenshen sunzenshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that the Mute checkbox is intuitive since on my machine the music just plays at minimum volume, but at least the cvars now update the sliders as expected.

@AdamTadeusz AdamTadeusz merged commit 454ac37 into NeotokyoRebuild:master Aug 17, 2025
7 checks passed
@AdamTadeusz AdamTadeusz deleted the 249_mp3PlayerVolumeShenanigans branch August 17, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants