Fix reached macOS UI primitives and audio fade behavior
This commit is contained in:
@@ -27,8 +27,55 @@ func _run() -> void:
|
||||
"sound volume was applied more than once")
|
||||
driver.play_sound_3d(sound, Vector3.ZERO, 0.5)
|
||||
_check(driver._all_3d.size() == 1, "3D sound not tracked")
|
||||
driver.play_sound_3d(sound, Vector3.ZERO, 0.5, 17, 0)
|
||||
driver.set_sound_volume_3d(17, 0.25)
|
||||
_check(absf(driver._active_3d[17].volume_db - linear_to_db(0.25)) < 0.01,
|
||||
"indexed 3D sound volume did not update")
|
||||
_check(driver._all_3d.size() == 2, "looping 3D sound not tracked")
|
||||
driver._active_3d[17].finished.emit()
|
||||
_check(driver._active_3d.has(17), "zero-loop-count ambience did not restart")
|
||||
driver.play_sound_3d(sound, Vector3.ZERO, 0.5, 18, 2)
|
||||
var twice: AudioStreamPlayer3D = driver._active_3d[18]
|
||||
twice.finished.emit()
|
||||
_check(driver._active_3d.has(18), "two-play ambience stopped after first play")
|
||||
twice.finished.emit()
|
||||
_check(not driver._active_3d.has(18), "two-play ambience did not finish")
|
||||
driver.stop_sound_3d(17)
|
||||
_check(not driver._active_3d.has(17), "StopSound3D left indexed sound running")
|
||||
driver.stop_all_sound_3d()
|
||||
_check(driver._all_3d.is_empty(), "StopAllSound3D left a player running")
|
||||
driver.play_music("login_window.mp3", 0.8)
|
||||
_check(driver._music_slot("login_window.mp3") == 0, "PlayMusic did not use slot 0")
|
||||
driver.fade_limit_out_music("login_window.mp3", 0.2, 0.1)
|
||||
for i in 8:
|
||||
driver._update_music_fades()
|
||||
_check(absf(driver._bgm_volumes[0] - 0.2) < 0.001,
|
||||
"FadeLimitOutMusic did not retain the requested limit")
|
||||
driver.fade_limit_out_music("login_window.mp3", 0.7, 0.1)
|
||||
driver._update_music_fades()
|
||||
_check(absf(driver._bgm_volumes[0] - 0.7) < 0.001,
|
||||
"40250 limit fade must clamp immediately when already below the limit")
|
||||
driver.fade_limit_out_music("login_window.mp3", 0.2, 0.5)
|
||||
driver._update_music_fades()
|
||||
driver.fade_out_music("another_track.mp3", 0.1)
|
||||
_check(not driver._bgm_fades.has(1), "FadeOutMusic affected an unrelated track")
|
||||
driver.fade_out_music("login_window.mp3", 0.1)
|
||||
for i in 2:
|
||||
driver._update_music_fades()
|
||||
_check(not driver._bgm[0].playing, "FadeOutMusic did not stop named track")
|
||||
driver.fade_in_music("characterselect.mp3", 0.3, 0.1)
|
||||
for i in 3:
|
||||
driver._update_music_fades()
|
||||
_check(absf(driver._bgm_volumes[0] - 0.3) < 0.001,
|
||||
"FadeInMusic did not advance by the requested frame step")
|
||||
for player in driver._bgm:
|
||||
player.stop()
|
||||
player.stream = null
|
||||
for player in driver._ui_pool:
|
||||
player.stop()
|
||||
player.stream = null
|
||||
driver._cache.clear()
|
||||
driver.free()
|
||||
await process_frame
|
||||
print("PASS: audio_driver_test" if failures == 0 else "FAIL: audio_driver_test")
|
||||
quit(0 if failures == 0 else 1)
|
||||
|
||||
Reference in New Issue
Block a user