generator.tscn 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. [gd_scene load_steps=3 format=3 uid="uid://deuhq8h4ymo7y"]
  2. [ext_resource type="Script" path="res://generator_demo.gd" id="1"]
  3. [sub_resource type="AudioStreamGenerator" id="AudioStreamGenerator_8tsrq"]
  4. [node name="Generator" type="Node"]
  5. script = ExtResource("1")
  6. [node name="Player" type="AudioStreamPlayer" parent="."]
  7. stream = SubResource("AudioStreamGenerator_8tsrq")
  8. volume_db = -12.041
  9. autoplay = true
  10. [node name="CenterContainer" type="VBoxContainer" parent="."]
  11. anchors_preset = 8
  12. anchor_left = 0.5
  13. anchor_top = 0.5
  14. anchor_right = 0.5
  15. anchor_bottom = 0.5
  16. offset_left = -200.0
  17. offset_top = -118.0
  18. offset_right = 200.0
  19. offset_bottom = 118.0
  20. grow_horizontal = 2
  21. grow_vertical = 2
  22. theme_override_constants/separation = 15
  23. [node name="FrequencyTitle" type="Label" parent="CenterContainer"]
  24. layout_mode = 2
  25. theme_override_colors/font_color = Color(0.466667, 0.882353, 1, 1)
  26. theme_override_font_sizes/font_size = 24
  27. text = "Generated Audio Frequency"
  28. [node name="Frequency" type="HBoxContainer" parent="CenterContainer"]
  29. custom_minimum_size = Vector2(400, 0)
  30. layout_mode = 2
  31. theme_override_constants/separation = 20
  32. [node name="FrequencyLabel" type="Label" parent="CenterContainer/Frequency"]
  33. unique_name_in_owner = true
  34. layout_mode = 2
  35. text = "440 Hz"
  36. [node name="FrequencyHSlider" type="HSlider" parent="CenterContainer/Frequency"]
  37. layout_mode = 2
  38. size_flags_horizontal = 3
  39. size_flags_vertical = 1
  40. min_value = 100.0
  41. max_value = 1000.0
  42. value = 440.0
  43. [node name="HSeparator" type="HSeparator" parent="CenterContainer"]
  44. custom_minimum_size = Vector2(0, 20)
  45. layout_mode = 2
  46. [node name="VolumeTitle" type="Label" parent="CenterContainer"]
  47. layout_mode = 2
  48. theme_override_colors/font_color = Color(0.466667, 0.882353, 1, 1)
  49. theme_override_font_sizes/font_size = 24
  50. text = "Playback Volume"
  51. [node name="Volume" type="HBoxContainer" parent="CenterContainer"]
  52. custom_minimum_size = Vector2(400, 0)
  53. layout_mode = 2
  54. theme_override_constants/separation = 20
  55. [node name="VolumeLabel" type="Label" parent="CenterContainer/Volume"]
  56. unique_name_in_owner = true
  57. layout_mode = 2
  58. text = "-12.04 dB"
  59. [node name="VolumeHSlider" type="HSlider" parent="CenterContainer/Volume"]
  60. layout_mode = 2
  61. size_flags_horizontal = 3
  62. size_flags_vertical = 1
  63. min_value = 0.001
  64. max_value = 1.0
  65. step = 0.001
  66. value = 0.25
  67. [connection signal="value_changed" from="CenterContainer/Frequency/FrequencyHSlider" to="." method="_on_frequency_h_slider_value_changed"]
  68. [connection signal="value_changed" from="CenterContainer/Volume/VolumeHSlider" to="." method="_on_volume_h_slider_value_changed"]