refactor fade_in/fade_out to drive volume_db directly and decouple from play/stop

Fades are now pure volume ramps: they no longer call play(), stop(), or
unpause. The animation is visible on the volume_db property each frame.
Track _target_volume_db separately so fade_in/fade_out round-trips return
to the user's set level instead of a transient lerp value, and skip the
"snap to silent" when interrupting an in-flight player or per-song
crossfade so audible state is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daniel Samson
2026-04-29 20:24:30 +01:00
co-authored by Claude Opus 4.7
parent 1e53fb83d1
commit 5204295864
5 changed files with 43 additions and 36 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ var _core : DynamicSoundPlayerCore;
func _set(property: StringName, value: Variant) -> bool:
if property == &"volume_db":
if _core: _core.apply_stream_volumes(value);
if _core: _core.on_volume_db_set(value);
return false;
return false;