-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDebugResampleTest.tscn
More file actions
193 lines (158 loc) · 4.85 KB
/
DebugResampleTest.tscn
File metadata and controls
193 lines (158 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[gd_scene load_steps=12 format=2]
[ext_resource path="res://ui/EGSlider.tscn" type="PackedScene" id=1]
[ext_resource path="res://DebugResampleTest.cs" type="Script" id=2]
[ext_resource path="res://addons/launchy/icon_load.svg" type="Texture" id=3]
[ext_resource path="res://ui/FileDialog.theme" type="Theme" id=4]
[ext_resource path="res://gfx/ui/icon_waveform.svg" type="Texture" id=5]
[ext_resource path="res://DebugResampleTestDisplay.gd" type="Script" id=6]
[sub_resource type="GDScript" id=4]
script/source = "extends Node
func _on_LOD_value_changed(value):
owner.currentLod = int(value)
owner.RecalcDisplay()
"
[sub_resource type="GDScript" id=1]
script/source = "extends Control
var ts = [Vector2(5,10)]
func _ready():
var a = str2var(\"[\\\"Vector2 ( 2, 4 )]\\\"]\")
print (a)
ts = a
func _on_Button_pressed():
$FileDialog.popup_centered()
pass # Replace with function body.
func _on_FileDialog_file_selected(path):
owner.LoadWave(path)
pass # Replace with function body.
func _on_Pause_toggled(button_pressed):
var p = owner.get_node(\"Player\")
p.playing = button_pressed
"
[sub_resource type="AudioStreamGenerator" id=2]
buffer_length = 0.1
[sub_resource type="GDScript" id=3]
script/source = "extends Control
func _physics_process(delta):
update()
func _draw():
var p = owner.PlaybackPosition * rect_size.x
draw_line(Vector2(p, 0), Vector2(p, rect_size.y), ColorN(\"white\", 0.8), 1, true)
"
[sub_resource type="GDScript" id=5]
script/source = "extends OptionButton
func _on_OptionButton_item_selected(index):
owner.SetResampleTechnique(index)
pass # Replace with function body.
func _on_SpinBox_value_changed(value):
owner.SetStrength(value)
pass # Replace with function body.
"
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 4 )
script = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true
}
[node name="Freq" parent="." instance=ExtResource( 1 )]
margin_left = 72.0
margin_top = 152.0
margin_right = 464.0
margin_bottom = 172.0
max_value = 64000.0
[node name="LOD" parent="." instance=ExtResource( 1 )]
margin_left = 72.0
margin_top = 200.0
margin_right = 464.0
margin_bottom = 220.0
max_value = 7.0
associated_property = "currentLod"
[node name="Control" type="Node" parent="LOD"]
script = SubResource( 4 )
[node name="Multiplier" parent="." instance=ExtResource( 1 )]
margin_left = 72.0
margin_top = 128.0
margin_right = 464.0
margin_bottom = 148.0
min_value = -16.0
max_value = 32.0
step = 0.01
value = 1.0
[node name="Aux" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
script = SubResource( 1 )
__meta__ = {
"_edit_lock_": true
}
[node name="Button" type="Button" parent="Aux"]
margin_left = 696.0
margin_top = 48.0
margin_right = 792.0
margin_bottom = 80.0
text = "Load"
icon = ExtResource( 3 )
[node name="FileDialog" type="FileDialog" parent="Aux"]
visible = true
margin_left = 488.0
margin_top = 144.0
margin_right = 1064.0
margin_bottom = 544.0
popup_exclusive = true
window_title = "Open a File"
resizable = true
mode = 0
access = 2
filters = PoolStringArray( "*.wav; RIFF WAVE" )
show_hidden_files = true
[node name="Pause" type="Button" parent="."]
margin_left = 88.0
margin_top = 48.0
margin_right = 224.0
margin_bottom = 96.0
toggle_mode = true
pressed = true
text = "Play * Pause"
icon = ExtResource( 5 )
[node name="Player" type="AudioStreamPlayer" parent="."]
stream = SubResource( 2 )
volume_db = -6.0
[node name="Display" type="ColorRect" parent="."]
margin_left = 40.0
margin_top = 328.0
margin_right = 848.0
margin_bottom = 576.0
color = Color( 0, 0, 0, 1 )
script = ExtResource( 6 )
[node name="Control" type="Control" parent="Display"]
anchor_right = 1.0
anchor_bottom = 1.0
script = SubResource( 3 )
__meta__ = {
"_edit_lock_": true
}
[node name="OptionButton" type="OptionButton" parent="."]
margin_left = 104.0
margin_top = 256.0
margin_right = 288.0
margin_bottom = 296.0
text = "No Resampling"
items = [ "No Resampling", null, false, 0, null, "LODs", null, false, 1, null, "LODs + Lerp", null, false, 2, null ]
selected = 0
script = SubResource( 5 )
[node name="SpinBox" type="SpinBox" parent="OptionButton"]
margin_left = 192.0
margin_right = 360.0
margin_bottom = 40.0
max_value = 8.0
step = 0.1
value = 1.0
suffix = "x"
[connection signal="value_changed" from="LOD" to="LOD/Control" method="_on_LOD_value_changed"]
[connection signal="value_changed" from="Multiplier" to="." method="SetSpeed"]
[connection signal="pressed" from="Aux/Button" to="Aux" method="_on_Button_pressed"]
[connection signal="file_selected" from="Aux/FileDialog" to="Aux" method="_on_FileDialog_file_selected"]
[connection signal="toggled" from="Pause" to="Aux" method="_on_Pause_toggled"]
[connection signal="item_selected" from="OptionButton" to="OptionButton" method="_on_OptionButton_item_selected"]
[connection signal="value_changed" from="OptionButton/SpinBox" to="OptionButton" method="_on_SpinBox_value_changed"]