Update bell

- Don't add the bell to the archive to keep it small a simplify
  licensing. Also bells seem to be rarely used with terminal emulators.
- Don't play the bell directly from the Terminal node by adding an
  AudioStreamPlayer, but make it easy to tune the "bell" signal behavior
  from the Terminal node so that only an AudioStreamPlayer node's play()
  method needs to be connected to it.
- Keep the bell.wav sound around for testing/demo.
This commit is contained in:
Leroy Hopson 2021-07-21 22:58:20 +07:00
parent d702021d02
commit 55b0a0577d
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
8 changed files with 42 additions and 30 deletions

View file

@ -10,6 +10,7 @@ func before_each():
func test_bell() -> void:
term.bell_cooldown = 0
term.write(char(7))
term.write(char(0x07))
term.write("\a")
@ -17,3 +18,14 @@ func test_bell() -> void:
term.write("'Ask not for whom the \a tolls; it tolls for thee' - John Donne")
yield(yield_to(term, "bell", 1), YIELD)
assert_signal_emit_count(term, "bell", 5)
func test_bell_cooldown() -> void:
watch_signals(term)
term.bell_cooldown = 0.5
term.write("\a")
term.write("\a")
yield(yield_for(0.5), YIELD)
term.write("\a")
yield(yield_to(term, "bell", 1), YIELD)
assert_signal_emit_count(term, "bell", 2)