Settings and Multi-layer
Had to implement multi-layer playback for duet playback, so why not implement multi-local-layer recording?
This commit is contained in:
parent
e1dc2d2be6
commit
9948a9fc26
|
@ -0,0 +1,92 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
var players = []
|
||||||
|
|
||||||
|
# Declare member variables here. Examples:
|
||||||
|
# var a = 2
|
||||||
|
# var b = "text"
|
||||||
|
var AudioSyncs = []
|
||||||
|
var AudioStreams = []
|
||||||
|
var AudioVolumes = []
|
||||||
|
export(VideoStreamWebm) var VideoStream
|
||||||
|
export(bool) var paused
|
||||||
|
export(int) var VideoDurationSeconds
|
||||||
|
export(float) var stream_position
|
||||||
|
export(float) var volume_db
|
||||||
|
signal finished
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
$VideoPlayer.stream = VideoStream
|
||||||
|
$VideoPlayer.paused = paused
|
||||||
|
$TextureProgress.max_value = VideoDurationSeconds
|
||||||
|
$VideoPlayer.volume_db = volume_db
|
||||||
|
print(">>>count is "+String(len(AudioSyncs))+","+String(len(players))+","+String(len(AudioStreams)))
|
||||||
|
|
||||||
|
func play():
|
||||||
|
$VideoPlayer.play()
|
||||||
|
|
||||||
|
func stop():
|
||||||
|
$VideoPlayer.stop()
|
||||||
|
for playerid in range(0,len(players)):
|
||||||
|
print(">>>Stopping player"+String(playerid))
|
||||||
|
players[playerid].stop()
|
||||||
|
|
||||||
|
func set_VideoStream(new_stream):
|
||||||
|
VideoStream = new_stream
|
||||||
|
if !is_inside_tree(): return
|
||||||
|
$VideoPlayer.stream = new_stream
|
||||||
|
print(">>>VideoStream is now "+new_stream.to_string())
|
||||||
|
|
||||||
|
func set_paused(value):
|
||||||
|
if !is_inside_tree(): return
|
||||||
|
$VideoPlayer.paused = value
|
||||||
|
paused = value
|
||||||
|
print(">>>Paused is now "+String(value))
|
||||||
|
|
||||||
|
func set_VideoDurationSeconds(value):
|
||||||
|
if !is_inside_tree(): return
|
||||||
|
$TextureProgress.max_value = value
|
||||||
|
VideoDurationSeconds = value
|
||||||
|
print(">>>VideoDurationSeconds is now "+String(value))
|
||||||
|
|
||||||
|
func set_volume_db(value):
|
||||||
|
if !is_inside_tree(): return
|
||||||
|
$VideoPlayer.volume_db = value
|
||||||
|
volume_db = value
|
||||||
|
print(">>>volume_db is now "+String(value))
|
||||||
|
|
||||||
|
func set_audio_volume_db(which, value):
|
||||||
|
players[which].set_volume_db(value)
|
||||||
|
|
||||||
|
func get_stream_position():
|
||||||
|
return $VideoPlayer.stream_position
|
||||||
|
|
||||||
|
func add_audio_stream(stream, delay):
|
||||||
|
var player = AudioStreamPlayer.new()
|
||||||
|
player.set_stream(stream)
|
||||||
|
player.volume_db = 1
|
||||||
|
player.pitch_scale = 1
|
||||||
|
add_child(player)
|
||||||
|
players.append(player)
|
||||||
|
AudioSyncs.append(delay)
|
||||||
|
AudioStreams.append(stream)
|
||||||
|
print(">>>added stream, count is now "+String(len(AudioSyncs))+","+String(len(players))+","+String(len(AudioStreams)))
|
||||||
|
|
||||||
|
func play_combined():
|
||||||
|
$VideoPlayer.play()
|
||||||
|
for playerid in range(0,len(players)):
|
||||||
|
print(">>>Playing player"+String(playerid))
|
||||||
|
players[playerid].play()
|
||||||
|
players[playerid].stream_paused = true
|
||||||
|
players[playerid].seek(AudioSyncs[playerid])
|
||||||
|
players[playerid].stream_paused = false
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta):
|
||||||
|
$TextureProgress.value = $VideoPlayer.stream_position
|
||||||
|
|
||||||
|
|
||||||
|
func _on_VideoPlayer_finished():
|
||||||
|
emit_signal("finished")
|
|
@ -0,0 +1,57 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Components/MultiStreamPlayer.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://UI/src/progressinner.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://UI/src/progressouter.png" type="Texture" id=3]
|
||||||
|
|
||||||
|
[node name="Control" type="Control"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="VideoPlayer" type="VideoPlayer" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 5.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = -5.0
|
||||||
|
margin_bottom = -5.0
|
||||||
|
autoplay = true
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="TextureProgress" type="TextureProgress" parent="."]
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 20.0
|
||||||
|
margin_top = -47.0
|
||||||
|
margin_right = -27.0
|
||||||
|
margin_bottom = -14.0
|
||||||
|
max_value = 313.701
|
||||||
|
step = 0.1
|
||||||
|
texture_progress = ExtResource( 2 )
|
||||||
|
nine_patch_stretch = true
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
margin_left = 15.0
|
||||||
|
margin_top = -51.0
|
||||||
|
margin_right = -5.0
|
||||||
|
margin_bottom = -5.0
|
||||||
|
rect_scale = Vector2( 0.5, 0.5 )
|
||||||
|
texture = ExtResource( 3 )
|
||||||
|
stretch_mode = 1
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
[connection signal="finished" from="VideoPlayer" to="." method="_on_VideoPlayer_finished"]
|
|
@ -0,0 +1,46 @@
|
||||||
|
extends Control
|
||||||
|
|
||||||
|
|
||||||
|
# Declare member variables here. Examples:
|
||||||
|
# var a = 2
|
||||||
|
# var b = "text"
|
||||||
|
signal volume_changed(slider,value)
|
||||||
|
var count = 0
|
||||||
|
var sliders = []
|
||||||
|
var values = []
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready():
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
func set_count(value):
|
||||||
|
for slice in $HBoxContainer.get_children():
|
||||||
|
slice.remove_and_skip()
|
||||||
|
sliders = []
|
||||||
|
for i in range(0,value):
|
||||||
|
if len(values) < value+1:
|
||||||
|
values.append(50)
|
||||||
|
var slice = VBoxContainer.new()
|
||||||
|
var slider = VSlider.new()
|
||||||
|
slider.hint_tooltip = "Vocal mix "+String(i+1)
|
||||||
|
slider.size_flags_vertical = SIZE_EXPAND_FILL
|
||||||
|
slider.value = values[i]
|
||||||
|
slider.connect("value_changed",self,"on_value_changed")
|
||||||
|
slice.add_child(slider)
|
||||||
|
sliders.append(slider)
|
||||||
|
var label = Label.new()
|
||||||
|
label.text = String(i+1)
|
||||||
|
label.hint_tooltip = "Vocal mix "+String(i+1)
|
||||||
|
label.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||||
|
slice.add_child(label)
|
||||||
|
$HBoxContainer.add_child(slice)
|
||||||
|
|
||||||
|
func on_value_changed(value):
|
||||||
|
for i in range(0,len(sliders)):
|
||||||
|
if values[i] != sliders[i].value:
|
||||||
|
values[i] = sliders[i].value
|
||||||
|
emit_signal("volume_changed",0,sliders[0].value)
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
#func _process(delta):
|
||||||
|
# pass
|
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_scene load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Components/MultiVolumeSlider.gd" type="Script" id=1]
|
||||||
|
|
||||||
|
[node name="Control" type="Control"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
size_flags_vertical = 3
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
|
@ -11,6 +11,9 @@ var recorder
|
||||||
var raw_recording
|
var raw_recording
|
||||||
var raw_recording_data
|
var raw_recording_data
|
||||||
var playable_recording_data
|
var playable_recording_data
|
||||||
|
var playing = false
|
||||||
|
var current_stream_added = false
|
||||||
|
var recorded_streams = 0
|
||||||
|
|
||||||
var position_changing_by_code
|
var position_changing_by_code
|
||||||
|
|
||||||
|
@ -32,15 +35,9 @@ func _ready():
|
||||||
#$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.max_value = duration
|
#$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.max_value = duration
|
||||||
|
|
||||||
## So we're back to VideoStreamWebM
|
## So we're back to VideoStreamWebM
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.set_stream(load(OS.get_user_data_dir()+"/converted.webm"))
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_VideoStream(load(OS.get_user_data_dir()+"/converted.webm"))
|
||||||
var vp = $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer
|
|
||||||
print(vp.stream.to_string())
|
|
||||||
vp.stream_position = -1
|
|
||||||
#var duration = Globals.video_duration
|
|
||||||
var duration = 313.701
|
var duration = 313.701
|
||||||
vp.stream_position = 0
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_VideoDurationSeconds(duration)
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.max_value = duration
|
|
||||||
print(duration)
|
|
||||||
|
|
||||||
# And set up the recording bus and meters
|
# And set up the recording bus and meters
|
||||||
var idx = AudioServer.get_bus_index("Record")
|
var idx = AudioServer.get_bus_index("Record")
|
||||||
|
@ -58,24 +55,25 @@ func _process(delta):
|
||||||
magnitude = spectrum_record.get_magnitude_for_frequency_range(0,11050.0).length()
|
magnitude = spectrum_record.get_magnitude_for_frequency_range(0,11050.0).length()
|
||||||
energy = clamp((60 + linear2db(magnitude)) / 60, 0, 1)
|
energy = clamp((60 + linear2db(magnitude)) / 60, 0, 1)
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer2/RecordMeter.value = energy * 100
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer2/RecordMeter.value = energy * 100
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2/VideoPos.text = "Video Pos : "+String($MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.stream_position)
|
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2/AudioPos.text = "Audio Pos : "+String($AudioStreamPlayer.get_playback_position())
|
|
||||||
if !position_changing_by_code:
|
|
||||||
position_changing_by_code = true
|
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider.value = $MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.stream_position
|
|
||||||
position_changing_by_code = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_RecButton_pressed():
|
func _on_RecButton_pressed():
|
||||||
if recorder.is_recording_active():
|
if recorder.is_recording_active():
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.stop()
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.stop()
|
||||||
raw_recording = recorder.get_recording()
|
raw_recording = recorder.get_recording()
|
||||||
|
current_stream_added = false
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.disabled = false
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.disabled = false
|
||||||
recorder.set_recording_active(false)
|
recorder.set_recording_active(false)
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record"
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record"
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/Status.text = ""
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/Status.text = ""
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2.set_count(recorded_streams)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.play()
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.play_combined()
|
||||||
|
if $MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text != "Record":
|
||||||
|
recorded_streams += 1
|
||||||
|
if recorded_streams == 0:
|
||||||
|
recorded_streams = 1
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.disabled = true
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.disabled = true
|
||||||
recorder.set_recording_active(true)
|
recorder.set_recording_active(true)
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Stop"
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Stop"
|
||||||
|
@ -84,18 +82,33 @@ func _on_RecButton_pressed():
|
||||||
|
|
||||||
func _on_PlayButton_pressed():
|
func _on_PlayButton_pressed():
|
||||||
var data = raw_recording.get_data()
|
var data = raw_recording.get_data()
|
||||||
$AudioStreamPlayer.stream = raw_recording
|
if playing:
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.play()
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.stop()
|
||||||
$AudioStreamPlayer.play()
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.text = "Play"
|
||||||
$AudioStreamPlayer.stream_paused = true
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.disabled = false
|
||||||
$AudioStreamPlayer.seek($MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.value/1000)
|
playing = false
|
||||||
$AudioStreamPlayer.stream_paused = false
|
else:
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.text = "Stop"
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record another layer"
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.disabled = true
|
||||||
|
if !current_stream_added:
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.add_audio_stream(raw_recording,$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.value/1000)
|
||||||
|
current_stream_added = true
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.play_combined()
|
||||||
|
playing = true
|
||||||
|
#$AudioStreamPlayer.stream = raw_recording
|
||||||
|
#$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.play()
|
||||||
|
#$AudioStreamPlayer.play()
|
||||||
|
#$AudioStreamPlayer.stream_paused = true
|
||||||
|
#$AudioStreamPlayer.seek($MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.value/1000)
|
||||||
|
#$AudioStreamPlayer.stream_paused = false
|
||||||
|
|
||||||
|
|
||||||
#$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/VideoPlayer.volume_db = linear2db(value/100)
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_volume_db(linear2db(value/100))
|
||||||
|
|
||||||
|
|
||||||
func _on_VocalSlider_value_changed(value):
|
func _on_VocalSlider_value_changed(value):
|
||||||
|
@ -104,26 +117,34 @@ func _on_VocalSlider_value_changed(value):
|
||||||
|
|
||||||
func _on_DelaySlider_value_changed(value):
|
func _on_DelaySlider_value_changed(value):
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/Label.text = "Audio Delay: "+String(value/1000)+"s"
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/Label.text = "Audio Delay: "+String(value/1000)+"s"
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.paused = true
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_paused(true)
|
||||||
$AudioStreamPlayer.stream_paused = true
|
$AudioStreamPlayer.stream_paused = true
|
||||||
$AudioStreamPlayer.seek($MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.stream_position + value/1000)
|
$AudioStreamPlayer.seek($MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.get_stream_position() + value/1000)
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.paused = false
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_paused(false)
|
||||||
$AudioStreamPlayer.stream_paused = false
|
$AudioStreamPlayer.stream_paused = false
|
||||||
Globals.audio_delay_seconds = value/1000
|
Globals.audio_delay_seconds = value/1000
|
||||||
Globals.saveConfig()
|
Globals.saveConfig()
|
||||||
|
|
||||||
|
|
||||||
func _on_VideoPosSlider_value_changed(value):
|
|
||||||
if !position_changing_by_code:
|
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.paused = true
|
|
||||||
$AudioStreamPlayer.stream_paused = true
|
|
||||||
position_changing_by_code = true
|
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.streamseek(value)
|
|
||||||
$AudioStreamPlayer.seek(value + $MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider.value/1000)
|
|
||||||
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPlayer.paused = false
|
|
||||||
position_changing_by_code = false
|
|
||||||
$AudioStreamPlayer.stream_paused = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_Quit_pressed():
|
func _on_Quit_pressed():
|
||||||
get_tree().change_scene("res://main_menu.tscn")
|
get_tree().change_scene("res://main_menu.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
func _on_MultiStreamVideoPlayer_finished():
|
||||||
|
if recorder.is_recording_active():
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.stop()
|
||||||
|
raw_recording = recorder.get_recording()
|
||||||
|
current_stream_added = false
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.disabled = false
|
||||||
|
recorder.set_recording_active(false)
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton.text = "Record another layer (part)"
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/Status.text = ""
|
||||||
|
if playing:
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.stop()
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton.text = "Play"
|
||||||
|
playing = false
|
||||||
|
|
||||||
|
|
||||||
|
func _on_VBoxContainer2_volume_changed(slider, value):
|
||||||
|
print("Slider "+String(slider)+" changed to "+String(value))
|
||||||
|
$MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer.set_audio_volume_db(slider,linear2db(value/100))
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
[gd_scene load_steps=5 format=2]
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Components/MultiStreamPlayer.tscn" type="PackedScene" id=1]
|
||||||
[ext_resource path="res://main_menu.gd" type="Script" id=2]
|
[ext_resource path="res://main_menu.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://PlayVideoRecordAudio.gd" type="Script" id=3]
|
[ext_resource path="res://PlayVideoRecordAudio.gd" type="Script" id=3]
|
||||||
[ext_resource path="res://UI/src/meter.png" type="Texture" id=4]
|
[ext_resource path="res://UI/src/meter.png" type="Texture" id=4]
|
||||||
|
[ext_resource path="res://Components/MultiVolumeSlider.tscn" type="PackedScene" id=5]
|
||||||
|
|
||||||
[sub_resource type="AudioStreamMicrophone" id=1]
|
[sub_resource type="AudioStreamMicrophone" id=1]
|
||||||
|
|
||||||
|
@ -75,21 +77,17 @@ size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
alignment = 1
|
alignment = 1
|
||||||
|
|
||||||
[node name="VideoPlayer" type="VideoPlayer" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
[node name="MultiStreamVideoPlayer" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer" instance=ExtResource( 1 )]
|
||||||
margin_right = 1013.0
|
anchor_right = 0.0
|
||||||
margin_bottom = 261.0
|
anchor_bottom = 0.0
|
||||||
size_flags_horizontal = 3
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="VideoPosSlider" type="HSlider" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
|
||||||
margin_top = 265.0
|
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 281.0
|
margin_bottom = 281.0
|
||||||
rect_min_size = Vector2( 500, 0 )
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
max_value = 10.0
|
size_flags_vertical = 3
|
||||||
step = 0.01
|
paused = false
|
||||||
editable = false
|
VideoDurationSeconds = 0
|
||||||
|
stream_position = 0.0
|
||||||
|
volume_db = 0.0
|
||||||
|
|
||||||
[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||||
margin_top = 309.0
|
margin_top = 309.0
|
||||||
|
@ -107,28 +105,28 @@ size_flags_vertical = 3
|
||||||
alignment = 1
|
alignment = 1
|
||||||
|
|
||||||
[node name="RecordButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="RecordButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 28.0
|
margin_top = 26.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 48.0
|
margin_bottom = 46.0
|
||||||
text = "Record"
|
text = "Record"
|
||||||
|
|
||||||
[node name="PlayButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="PlayButton" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 52.0
|
margin_top = 50.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 72.0
|
margin_bottom = 70.0
|
||||||
disabled = true
|
disabled = true
|
||||||
text = "Play"
|
text = "Play"
|
||||||
|
|
||||||
[node name="Status" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="Status" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 76.0
|
margin_top = 74.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 91.0
|
margin_bottom = 89.0
|
||||||
fit_content_height = true
|
fit_content_height = true
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 95.0
|
margin_top = 93.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 111.0
|
margin_bottom = 109.0
|
||||||
|
|
||||||
[node name="Playbacklabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer"]
|
[node name="Playbacklabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer"]
|
||||||
margin_right = 110.0
|
margin_right = 110.0
|
||||||
|
@ -151,9 +149,9 @@ texture_progress = ExtResource( 4 )
|
||||||
nine_patch_stretch = true
|
nine_patch_stretch = true
|
||||||
|
|
||||||
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 115.0
|
margin_top = 113.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 131.0
|
margin_bottom = 129.0
|
||||||
|
|
||||||
[node name="Recordlabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer2"]
|
[node name="Recordlabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer2"]
|
||||||
margin_right = 110.0
|
margin_right = 110.0
|
||||||
|
@ -173,32 +171,37 @@ texture_progress = ExtResource( 4 )
|
||||||
nine_patch_stretch = true
|
nine_patch_stretch = true
|
||||||
|
|
||||||
[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="HBoxContainer3" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 135.0
|
margin_top = 133.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 235.0
|
margin_bottom = 251.0
|
||||||
|
|
||||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3"]
|
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3"]
|
||||||
margin_right = 620.0
|
margin_right = 524.0
|
||||||
margin_bottom = 100.0
|
margin_bottom = 118.0
|
||||||
|
|
||||||
[node name="BackgroundaudioSlider" type="VSlider" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
[node name="VBoxContainer3" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
||||||
|
margin_right = 16.0
|
||||||
|
margin_bottom = 118.0
|
||||||
|
|
||||||
|
[node name="BackgroundaudioSlider" type="VSlider" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer3"]
|
||||||
margin_right = 16.0
|
margin_right = 16.0
|
||||||
margin_bottom = 100.0
|
margin_bottom = 100.0
|
||||||
rect_min_size = Vector2( 0, 100 )
|
rect_min_size = Vector2( 0, 100 )
|
||||||
value = 50.0
|
value = 50.0
|
||||||
|
|
||||||
[node name="VocalSlider" type="VSlider" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer3"]
|
||||||
margin_left = 20.0
|
margin_top = 104.0
|
||||||
margin_right = 36.0
|
margin_right = 16.0
|
||||||
margin_bottom = 100.0
|
margin_bottom = 118.0
|
||||||
rect_min_size = Vector2( 0, 100 )
|
rect_min_size = Vector2( 16, 0 )
|
||||||
max_value = 100.0
|
text = "B"
|
||||||
value = 50.0
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
||||||
margin_left = 40.0
|
margin_left = 20.0
|
||||||
margin_right = 540.0
|
margin_right = 520.0
|
||||||
margin_bottom = 100.0
|
margin_bottom = 118.0
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer"]
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer"]
|
||||||
margin_right = 500.0
|
margin_right = 500.0
|
||||||
|
@ -218,52 +221,17 @@ size_flags_horizontal = 3
|
||||||
max_value = 1000.0
|
max_value = 1000.0
|
||||||
editable = false
|
editable = false
|
||||||
|
|
||||||
[node name="VBoxContainer2" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer"]
|
[node name="VBoxContainer2" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer" instance=ExtResource( 5 )]
|
||||||
margin_left = 544.0
|
anchor_right = 0.0
|
||||||
margin_right = 620.0
|
anchor_bottom = 0.0
|
||||||
margin_bottom = 100.0
|
margin_left = 524.0
|
||||||
|
margin_right = 524.0
|
||||||
[node name="AudioPos" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2"]
|
margin_bottom = 118.0
|
||||||
margin_right = 76.0
|
|
||||||
margin_bottom = 14.0
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Audio Pos : "
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="VideoPos" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2"]
|
|
||||||
margin_top = 18.0
|
|
||||||
margin_right = 76.0
|
|
||||||
margin_bottom = 49.0
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
text = "Video Pos :
|
|
||||||
"
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_use_anchors_": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
[node name="HBoxContainer4" type="HBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer"]
|
||||||
margin_top = 239.0
|
margin_top = 255.0
|
||||||
margin_right = 1013.0
|
margin_right = 1013.0
|
||||||
margin_bottom = 253.0
|
margin_bottom = 255.0
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer4"]
|
|
||||||
margin_right = 16.0
|
|
||||||
margin_bottom = 14.0
|
|
||||||
rect_min_size = Vector2( 16, 0 )
|
|
||||||
text = "B"
|
|
||||||
align = 1
|
|
||||||
valign = 1
|
|
||||||
|
|
||||||
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer4"]
|
|
||||||
margin_left = 20.0
|
|
||||||
margin_right = 36.0
|
|
||||||
margin_bottom = 14.0
|
|
||||||
rect_min_size = Vector2( 16, 0 )
|
|
||||||
text = "V"
|
|
||||||
align = 1
|
|
||||||
valign = 1
|
|
||||||
|
|
||||||
[node name="AudioStreamRecorder" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamRecorder" type="AudioStreamPlayer" parent="."]
|
||||||
stream = SubResource( 1 )
|
stream = SubResource( 1 )
|
||||||
|
@ -272,9 +240,9 @@ bus = "Record"
|
||||||
|
|
||||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/Quit" to="." method="_on_Quit_pressed"]
|
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer2/Quit" to="." method="_on_Quit_pressed"]
|
||||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/VideoPosSlider" to="." method="_on_VideoPosSlider_value_changed"]
|
[connection signal="finished" from="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/MultiStreamVideoPlayer" to="." method="_on_MultiStreamVideoPlayer_finished"]
|
||||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton" to="." method="_on_RecButton_pressed"]
|
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/RecordButton" to="." method="_on_RecButton_pressed"]
|
||||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton" to="." method="_on_PlayButton_pressed"]
|
[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/PlayButton" to="." method="_on_PlayButton_pressed"]
|
||||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/BackgroundaudioSlider" to="." method="_on_BackgroundaudioSlider_changed"]
|
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer3/BackgroundaudioSlider" to="." method="_on_BackgroundaudioSlider_changed"]
|
||||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VocalSlider" to="." method="_on_VocalSlider_value_changed"]
|
|
||||||
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider" to="." method="_on_DelaySlider_value_changed"]
|
[connection signal="value_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer/DelaySlider" to="." method="_on_DelaySlider_value_changed"]
|
||||||
|
[connection signal="volume_changed" from="MarginContainer/VBoxContainer/HBoxContainer3/VBoxContainer/HBoxContainer3/HBoxContainer/VBoxContainer2" to="." method="_on_VBoxContainer2_volume_changed"]
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/progressinner.png-72812c01d686d034e73942a10c351d3e.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://UI/src/progressinner.png"
|
||||||
|
dest_files=[ "res://.import/progressinner.png-72812c01d686d034e73942a10c351d3e.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/progressouter.png-d3de60f4aacc5453ec3d3cad80c52ba7.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://UI/src/progressouter.png"
|
||||||
|
dest_files=[ "res://.import/progressouter.png-d3de60f4aacc5453ec3d3cad80c52ba7.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
Loading…
Reference in New Issue