feat: Allow volume control of Music & Sound with property#1311
Open
DeathPhoenix22 wants to merge 1 commit intoAlmasB:devfrom
Open
feat: Allow volume control of Music & Sound with property#1311DeathPhoenix22 wants to merge 1 commit intoAlmasB:devfrom
DeathPhoenix22 wants to merge 1 commit intoAlmasB:devfrom
Conversation
DeathPhoenix22
commented
Oct 24, 2023
|
|
||
| private val loader = DesktopAndMobileAudioLoader() | ||
|
|
||
| override fun onMainLoopStarting() { |
Contributor
Author
There was a problem hiding this comment.
Automatically handled by the Audio with Property change listeners
DeathPhoenix22
commented
Oct 24, 2023
| if (!activeSounds.containsByIdentity(sound)) | ||
| activeSounds.add(sound) | ||
|
|
||
| sound.audio.setVolume(soundVolume.value) |
Contributor
Author
There was a problem hiding this comment.
No need anymore, the global volumes are automatically mixed with the Media configured sound
birdingman0626
added a commit
to birdingman0626/FXGL
that referenced
this pull request
Jul 8, 2025
### Critical Bug Fixes and Feature Implementations - ✅ **Particle System Object Pool Fix (AlmasB#1417)**: Fixed memory leak by replacing Point2D with pooled Vec2 objects - ✅ **Physics Component Acceleration Control (AlmasB#1411)**: Already implemented with comprehensive acceleration methods - ✅ **Game Window Size Constraints (AlmasB#1410)**: Already implemented with min/max window size configuration - ✅ **Volume Control with Property Binding (AlmasB#1311)**: Already implemented with real-time volume control - ✅ **Comprehensive Behavior Tree System**: Already implemented with full AI behavior tree support ### Technical Implementation Details - **Object Pool Optimization**: ParticleSystem now uses Vec2 pooling for better memory management - **Physics System Enhancement**: Acceleration methods supporting both pixel and meter-based units - **UI System Improvements**: Window constraints fully integrated with JavaFX window management - **Audio System Upgrade**: Real-time volume control with bidirectional property binding - **AI System Expansion**: Full behavior tree implementation with DSL and pre-built behaviors ### Documentation Updates - Updated README.md with all implemented features and enhancements - Updated CLAUDE.md with technical implementation details - Added comprehensive test running instructions ### Build Status - ✅ All modules compile successfully with Java 17 - ✅ Zero compilation warnings or errors - ✅ Production ready for Java 17 deployment 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
Issue Link: #1310
Here's an implementation that allow custom Volume configuration of all Sounds & Musics. I've placed the "Master / Global" volume property of the AudioType inside them. This felt pretty natural since the "expert" (GRAPS) of that information is the AudioType itself. This also mean that we could really easily add a new AudioType without much efforts and that new type would automatically mix itself against the Global and the current Audio.
@AlmasB NOTE: I took the initiative to revert the changes made in #1187. Granting access to the internal audio is causing a bug related to volume adjustments in the settings. Whenever a player was adjusting his Global volume, all custom changes made on the audio (getAudio()) was automatically reverted. With this implementation, the conjunction of the 2 values are always kept (via the mix() method)
Example:
Note that changing the Global Music volume will also automatically impact all Music:
I've tested it on my own game and I needed it!
I hope you like it! :)