-
-
Notifications
You must be signed in to change notification settings - Fork 621
feat: Allow volume control of Music & Sound with property #1311
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
base: dev
Are you sure you want to change the base?
Conversation
@Inject("isPauseMusicWhenMinimized") | ||
private var isPauseMusicWhenMinimized = true | ||
|
||
private val loader = DesktopAndMobileAudioLoader() | ||
|
||
override fun onMainLoopStarting() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automatically handled by the Audio with Property change listeners
@@ -74,7 +57,6 @@ class AudioPlayer : EngineService() { | |||
if (!activeSounds.containsByIdentity(sound)) | |||
activeSounds.add(sound) | |||
|
|||
sound.audio.setVolume(soundVolume.value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need anymore, the global volumes are automatically mixed with the Media configured sound
### 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]>
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! :)