mirror of
https://github.com/litruv/PNGTuber-Plus.git
synced 2026-07-24 02:26:02 +10:00
NDI Working
This commit is contained in:
@@ -48,6 +48,9 @@ func setvalues():
|
||||
|
||||
$experimentalMicLoudness/checkmark.button_pressed = Global.experimentalMicLoudness
|
||||
|
||||
# Initialize NDI settings
|
||||
setup_ndi_settings()
|
||||
|
||||
func _on_color_picker_button_color_changed(color):
|
||||
get_viewport().transparent_bg = false
|
||||
RenderingServer.set_default_clear_color(color)
|
||||
@@ -264,3 +267,45 @@ func _on_delete_9_pressed():
|
||||
func _on_delete_10_pressed():
|
||||
var label = $CostumeInputs/ScrollContainer/VBoxContainer/costumeButton10/Label
|
||||
deleteKey(label,10)
|
||||
|
||||
## NDI Output Settings Methods
|
||||
|
||||
func _on_ndi_enabled_check_toggled(toggled_on: bool):
|
||||
# Enable/disable NDI streaming
|
||||
if Global.main.ndi_output:
|
||||
print("NDI streaming ", "enabled" if toggled_on else "disabled")
|
||||
update_ndi_status()
|
||||
|
||||
func _on_ndi_source_name_text_changed(new_text: String):
|
||||
# Update NDI source name
|
||||
if Global.main.ndi_output:
|
||||
Global.main.ndi_output.name = new_text
|
||||
print("NDI source name changed to: ", new_text)
|
||||
|
||||
func _on_ndi_audio_check_toggled(toggled_on: bool):
|
||||
# Enable/disable audio in NDI stream
|
||||
if Global.main.ndi_output:
|
||||
if toggled_on:
|
||||
Global.main.ndi_output.audio_bus = StringName("Master")
|
||||
else:
|
||||
Global.main.ndi_output.audio_bus = StringName("")
|
||||
print("NDI audio ", "enabled" if toggled_on else "disabled")
|
||||
|
||||
func _on_ndi_toggle_button_pressed():
|
||||
# Toggle NDI streaming on/off - NDI is always on when the node exists
|
||||
print("NDI toggle pressed - NDI is active when node exists")
|
||||
update_ndi_status()
|
||||
|
||||
func update_ndi_status():
|
||||
# Update the status label and button text
|
||||
if Global.main.ndi_output:
|
||||
$NDIOutput/StatusLabel.text = "Status: Active (NDI Source: " + Global.main.ndi_output.name + ")"
|
||||
$NDIOutput/toggleButton.text = "NDI Active"
|
||||
$NDIOutput/ndiEnabledCheck.button_pressed = true
|
||||
|
||||
func setup_ndi_settings():
|
||||
# Initialize NDI settings UI with current values
|
||||
if Global.main.ndi_output:
|
||||
$NDIOutput/ndiSourceName.text = Global.main.ndi_output.name
|
||||
$NDIOutput/ndiAudioCheck.button_pressed = (Global.main.ndi_output.audio_bus != StringName(""))
|
||||
update_ndi_status()
|
||||
|
||||
@@ -14335,8 +14335,68 @@ offset_right = 154.0
|
||||
offset_bottom = 25.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="NDIOutput" type="Node2D" parent="."]
|
||||
position = Vector2(16, 433)
|
||||
|
||||
[node name="Label" type="Label" parent="NDIOutput"]
|
||||
offset_right = 138.0
|
||||
offset_bottom = 34.0
|
||||
text = "NDI streaming"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ndiEnabledCheck" type="CheckBox" parent="NDIOutput"]
|
||||
offset_left = 130.0
|
||||
offset_top = 1.0
|
||||
offset_right = 154.0
|
||||
offset_bottom = 25.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="SourceNameLabel" type="Label" parent="NDIOutput"]
|
||||
offset_top = 32.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 50.0
|
||||
text = "source name:"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ndiSourceName" type="LineEdit" parent="NDIOutput"]
|
||||
offset_left = 105.0
|
||||
offset_top = 30.0
|
||||
offset_right = 250.0
|
||||
offset_bottom = 52.0
|
||||
text = "PNGTuber-Plus"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="AudioLabel" type="Label" parent="NDIOutput"]
|
||||
offset_top = 60.0
|
||||
offset_right = 100.0
|
||||
offset_bottom = 78.0
|
||||
text = "include audio:"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="ndiAudioCheck" type="CheckBox" parent="NDIOutput"]
|
||||
offset_left = 130.0
|
||||
offset_top = 58.0
|
||||
offset_right = 154.0
|
||||
offset_bottom = 82.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="NDIOutput"]
|
||||
offset_top = 88.0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 106.0
|
||||
text = "Status: Not streaming"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="toggleButton" type="Button" parent="NDIOutput"]
|
||||
offset_left = 260.0
|
||||
offset_top = 85.0
|
||||
offset_right = 340.0
|
||||
offset_bottom = 110.0
|
||||
text = "Start NDI"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="bounceOnCostume" type="Node2D" parent="."]
|
||||
position = Vector2(17, 305)
|
||||
position = Vector2(17, 565)
|
||||
|
||||
[node name="Label" type="Label" parent="bounceOnCostume"]
|
||||
offset_right = 138.0
|
||||
@@ -14935,3 +14995,7 @@ metadata/_edit_use_anchors_ = true
|
||||
[connection signal="pressed" from="CostumeInputs/ScrollContainer/VBoxContainer/costumeButton10/delete10" to="." method="_on_delete_10_pressed"]
|
||||
[connection signal="value_changed" from="BlinkSpeed/blinkSpeed" to="." method="_on_blink_speed_value_changed"]
|
||||
[connection signal="value_changed" from="BlinkChance/blinkChance" to="." method="_on_blink_chance_value_changed"]
|
||||
[connection signal="toggled" from="NDIOutput/ndiEnabledCheck" to="." method="_on_ndi_enabled_check_toggled"]
|
||||
[connection signal="text_changed" from="NDIOutput/ndiSourceName" to="." method="_on_ndi_source_name_text_changed"]
|
||||
[connection signal="toggled" from="NDIOutput/ndiAudioCheck" to="." method="_on_ndi_audio_check_toggled"]
|
||||
[connection signal="pressed" from="NDIOutput/toggleButton" to="." method="_on_ndi_toggle_button_pressed"]
|
||||
|
||||
Reference in New Issue
Block a user