audioplayer.tscn 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. [gd_scene load_steps=2 format=3 uid="uid://csapiqka522fh"]
  2. [ext_resource type="Script" uid="uid://clmtlg8via3qn" path="res://scenes/Nodes/audioplayer.gd" id="1_yprak"]
  3. [node name="Control" type="Control"]
  4. custom_minimum_size = Vector2(400, 0)
  5. layout_mode = 3
  6. anchors_preset = 15
  7. anchor_right = 1.0
  8. anchor_bottom = 1.0
  9. offset_right = -880.0
  10. offset_bottom = -544.0
  11. grow_horizontal = 2
  12. grow_vertical = 2
  13. script = ExtResource("1_yprak")
  14. metadata/loadenable = false
  15. [node name="Panel" type="Panel" parent="."]
  16. layout_mode = 0
  17. offset_right = 400.0
  18. offset_bottom = 120.0
  19. [node name="Label" type="Label" parent="."]
  20. visible = false
  21. layout_mode = 0
  22. offset_left = 8.0
  23. offset_top = 5.0
  24. offset_right = 232.0
  25. offset_bottom = 28.0
  26. text = "Drop files here or load below"
  27. [node name="FileDialog" type="FileDialog" parent="."]
  28. title = "Select input file"
  29. use_native_dialog = true
  30. [node name="LoadButton" type="Button" parent="."]
  31. layout_mode = 0
  32. offset_top = 128.0
  33. offset_right = 128.0
  34. offset_bottom = 171.0
  35. text = "Load File"
  36. [node name="RecycleButton" type="Button" parent="." groups=["outputnode"]]
  37. layout_mode = 0
  38. offset_left = 272.0
  39. offset_top = 128.0
  40. offset_right = 400.0
  41. offset_bottom = 171.0
  42. tooltip_text = "Copies your output file back to your input for further processing."
  43. text = "Reuse Output"
  44. metadata/outputfunction = "recycle"
  45. [node name="PlayButton" type="Button" parent="."]
  46. layout_mode = 0
  47. offset_left = 136.0
  48. offset_top = 128.0
  49. offset_right = 264.0
  50. offset_bottom = 171.0
  51. text = "Play"
  52. [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
  53. [node name="WavError" type="Window" parent="."]
  54. title = "Wrong File Type"
  55. initial_position = 2
  56. size = Vector2i(350, 100)
  57. visible = false
  58. transient = true
  59. exclusive = true
  60. unresizable = true
  61. borderless = true
  62. popup_window = true
  63. [node name="Label" type="Label" parent="WavError"]
  64. offset_right = 349.0
  65. offset_bottom = 58.0
  66. text = "Wrong file type
  67. Only WAV files are supported"
  68. horizontal_alignment = 1
  69. vertical_alignment = 1
  70. autowrap_mode = 2
  71. [node name="CloseButton" type="Button" parent="WavError"]
  72. offset_left = 143.0
  73. offset_top = 62.0
  74. offset_right = 207.0
  75. offset_bottom = 93.0
  76. text = "Ok"
  77. [node name="WaveformPreview" type="TextureRect" parent="."]
  78. layout_mode = 0
  79. offset_right = 400.0
  80. offset_bottom = 96.0
  81. expand_mode = 2
  82. [node name="Playhead" type="Line2D" parent="."]
  83. points = PackedVector2Array(0, 0, 0, 96)
  84. width = 2.0
  85. default_color = Color(1, 1, 1, 0.541176)
  86. [node name="LoopRegion" type="ColorRect" parent="."]
  87. layout_mode = 0
  88. offset_bottom = 96.0
  89. focus_mode = 1
  90. color = Color(1, 1, 1, 0.0941176)
  91. [node name="Button" type="Button" parent="."]
  92. layout_mode = 0
  93. offset_right = 400.0
  94. offset_bottom = 96.0
  95. flat = true
  96. [node name="Timer" type="Timer" parent="."]
  97. [node name="StartLabel" type="Label" parent="."]
  98. layout_mode = 0
  99. offset_left = 5.0
  100. offset_top = 97.0
  101. offset_right = 149.0
  102. offset_bottom = 116.0
  103. text = "00:00.00"
  104. [node name="EndLabel" type="Label" parent="."]
  105. layout_mode = 0
  106. offset_left = 250.0
  107. offset_top = 97.0
  108. offset_right = 394.0
  109. offset_bottom = 116.0
  110. text = "00:00.00"
  111. horizontal_alignment = 2
  112. [connection signal="button_down" from="LoadButton" to="." method="_on_load_button_button_down"]
  113. [connection signal="button_down" from="RecycleButton" to="." method="recycle_outfile"]
  114. [connection signal="button_down" from="PlayButton" to="." method="_on_play_button_button_down"]
  115. [connection signal="button_down" from="WavError/CloseButton" to="." method="_on_close_button_button_down"]
  116. [connection signal="button_down" from="Button" to="." method="_on_button_button_down"]
  117. [connection signal="button_up" from="Button" to="." method="_on_button_button_up"]
  118. [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]