Fix sliders
continuous-integration/drone/tag Build is failing Details

This commit is contained in:
Martyn 2020-09-27 23:08:34 +02:00
parent 4f97d9bc47
commit 6f6d64fcd8
2 changed files with 26 additions and 8 deletions

View File

@ -17,6 +17,7 @@ var recorded_streams = 0
var streams_recorded_here = [] var streams_recorded_here = []
var stream_data = [] var stream_data = []
var position_changing_by_code var position_changing_by_code
var delays = []
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
@ -46,9 +47,9 @@ func _ready():
spectrum_play = AudioServer.get_bus_effect_instance(0,0) spectrum_play = AudioServer.get_bus_effect_instance(0,0)
spectrum_record = AudioServer.get_bus_effect_instance(1,1) spectrum_record = AudioServer.get_bus_effect_instance(1,1)
position_changing_by_code = false position_changing_by_code = false
$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Save separate streams") #$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Save separate streams")
$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Save mixed down") #$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Save mixed down")
$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Publish") #$MarginContainer/VBoxContainer/HBoxContainer4/SaveButton.get_popup().add_item("Publish")
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
@ -97,7 +98,7 @@ func _on_PlayButton_pressed():
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record another layer (part)" $MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record another layer (part)"
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.disabled = true $MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.disabled = true
if !current_stream_added: if !current_stream_added:
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.add_audio_stream(raw_recording,$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.value/1000) $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.add_audio_stream(raw_recording,Globals.audio_delay_seconds)
current_stream_added = true current_stream_added = true
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.play_combined() $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.play_combined()
playing = true playing = true
@ -110,7 +111,7 @@ func _on_PlayButton_pressed():
#$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.editable = true #$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.editable = true
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.editable = true #$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.editable = true
func _on_BackgroundaudioSlider_changed(value): func _on_BackgroundaudioSlider_changed(value):
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_volume_db(linear2db(value/100)) $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_volume_db(linear2db(value/100))
@ -164,4 +165,7 @@ func _on_MultiDelaySlider_delay_changed(slider, value):
func _on_SaveButton_pressed(): func _on_SaveButton_pressed():
for streamid in range(0,len(stream_data)): for streamid in range(0,len(stream_data)):
stream_data[streamid].save_to_wav("user://part"+String(streamid+1)+".wav") stream_data[streamid].save_to_wav("user://part"+String(streamid+1)+".wav")
func _on_PublishButton_pressed():
pass # Replace with function body. pass # Replace with function body.

View File

@ -226,10 +226,23 @@ __meta__ = {
"_edit_use_anchors_": false "_edit_use_anchors_": false
} }
[node name="SaveButton" type="MenuButton" parent="MarginContainer/VBoxContainer/HBoxContainer4"] [node name="StatusLabel" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer4"]
margin_right = 109.0 margin_top = 3.0
margin_right = 905.0
margin_bottom = 17.0
size_flags_horizontal = 3
[node name="SaveButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer4"]
margin_left = 909.0
margin_right = 950.0
margin_bottom = 20.0 margin_bottom = 20.0
text = "Save or Publish" text = "Save"
[node name="PublishButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer4"]
margin_left = 954.0
margin_right = 1013.0
margin_bottom = 20.0
text = "Publish"
[node name="AudioStreamRecorder" type="AudioStreamPlayer" parent="."] [node name="AudioStreamRecorder" type="AudioStreamPlayer" parent="."]
stream = SubResource( 1 ) stream = SubResource( 1 )
@ -245,3 +258,4 @@ bus = "Record"
[connection signal="delay_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/MultiDelaySlider" to="." method="_on_MultiDelaySlider_delay_changed"] [connection signal="delay_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/MultiDelaySlider" to="." method="_on_MultiDelaySlider_delay_changed"]
[connection signal="volume_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/MultiVolumeSlider" to="." method="_on_VBoxContainer2_volume_changed"] [connection signal="volume_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/MultiVolumeSlider" to="." method="_on_VBoxContainer2_volume_changed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer4/SaveButton" to="." method="_on_SaveButton_pressed"] [connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer4/SaveButton" to="." method="_on_SaveButton_pressed"]
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer4/PublishButton" to="." method="_on_PublishButton_pressed"]