mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-03 20:14:22 +02:00
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:
parent
d702021d02
commit
55b0a0577d
8 changed files with 42 additions and 30 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue