[gd_scene load_steps=5 format=3 uid="uid://bcs87y7ptx3ke"]

[ext_resource type="Script" uid="uid://bdlfvuljckmu1" path="res://scenes/main/control.gd" id="1_2f0aq"]
[ext_resource type="Script" uid="uid://l2yejnjysupr" path="res://scenes/main/graph_edit.gd" id="2_3ioqo"]
[ext_resource type="PackedScene" uid="uid://b0wdj8v6o0wq0" path="res://scenes/menu/menu.tscn" id="3_dtf4o"]
[ext_resource type="Texture2D" uid="uid://cdwux1smquvpi" path="res://theme/images/logo.png" id="4_3ioqo"]

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_2f0aq")

[node name="GraphEdit" type="GraphEdit" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 32.0
right_disconnects = true
script = ExtResource("2_3ioqo")

[node name="FileDialog" type="FileDialog" parent="."]
title = "Open a Directory"
ok_button_text = "Select Current Folder"
file_mode = 2
access = 2
use_native_dialog = true

[node name="mainmenu" parent="." instance=ExtResource("3_dtf4o")]
visible = false
layout_mode = 1
offset_top = 35.0

[node name="NoLocationPopup" type="Window" parent="." groups=["popup_windows"]]
auto_translate_mode = 1
title = "Wrong File Type"
initial_position = 2
size = Vector2i(450, 500)
transient = true
exclusive = true
unresizable = true
borderless = true
popup_window = true

[node name="TextureRect" type="TextureRect" parent="NoLocationPopup"]
offset_left = -6.0
offset_top = 16.0
offset_right = 378.0
offset_bottom = 64.0
texture = ExtResource("4_3ioqo")
expand_mode = 2
stretch_mode = 4

[node name="RichTextLabel" type="RichTextLabel" parent="NoLocationPopup"]
offset_left = 16.0
offset_top = 73.0
offset_right = 435.0
offset_bottom = 457.0
bbcode_enabled = true
text = "Welcome to SoundThread! 

SoundThread is an interface for the Composers Desktop Project (CDP) audio processing tools. As such it requires you to have CDP installed to work correctly. If you don't already have CDP installed you can [url=\"https://www.unstablesound.net/cdp.html\"]download it here.[/url]

When you close this window you will be prompted for the location of your _cdprogs folder. The default location for this folder is:
Windows: C:/cdpr8/_cdp/_cdprogs
Mac: ~/cdpr8/_cdp/_cdprogs

SoundThread will remember this but you can always change it later in Settings.

If this is your first time using SoundThread you can find some getting started tutorials in the Help tab in the top menu."
scroll_active = false

[node name="OkButton" type="Button" parent="NoLocationPopup"]
offset_left = -7.0
offset_top = 469.0
offset_right = 457.0
offset_bottom = 500.0
text = "Click to locate _cdprogs"

[node name="NoInputPopup" type="Window" parent="." groups=["popup_windows"]]
auto_translate_mode = 1
title = "No Input Selected"
initial_position = 2
size = Vector2i(380, 140)
visible = false
transient = true
exclusive = true
unresizable = true
borderless = true
popup_window = true

[node name="Label" type="Label" parent="NoInputPopup"]
offset_left = 14.0
offset_top = 7.0
offset_right = 363.0
offset_bottom = 100.0
text = "No input file selected

Please load a sound file into Input File node
Supported file type: .wav, mono or stereo"
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2

[node name="OkButton2" type="Button" parent="NoInputPopup"]
offset_left = -10.0
offset_top = 110.0
offset_right = 390.0
offset_bottom = 141.0
text = "Ok"

[node name="MultipleConnectionsPopup" type="Window" parent="." groups=["popup_windows"]]
auto_translate_mode = 1
title = "No Input Selected"
initial_position = 2
size = Vector2i(380, 160)
visible = false
transient = true
exclusive = true
unresizable = true
borderless = true
popup_window = true

[node name="Label" type="Label" parent="MultipleConnectionsPopup"]
offset_left = 14.0
offset_top = 10.0
offset_right = 363.0
offset_bottom = 117.0
text = "PVOC Nodes can only have one input.

To mix sounds created in the frequency domain convert them to the time domain using PVOC: Resynthesise first."
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2

[node name="OkButton3" type="Button" parent="MultipleConnectionsPopup"]
offset_left = -10.0
offset_top = 128.0
offset_right = 389.0
offset_bottom = 159.0
text = "Ok"

[node name="CdpLocationDialog" type="FileDialog" parent="."]
title = "Open a Directory"
ok_button_text = "Select Current Folder"
file_mode = 2
access = 2
use_native_dialog = true

[node name="Console" type="Window" parent="." groups=["popup_windows"]]
title = "Generating Output"
initial_position = 5
size = Vector2i(600, 400)
visible = false
unresizable = true
always_on_top = true

[node name="Panel" type="Panel" parent="Console"]
offset_left = 10.0
offset_top = 8.0
offset_right = 590.0
offset_bottom = 352.0

[node name="ConsoleOutput" type="RichTextLabel" parent="Console"]
offset_left = 10.0
offset_top = 12.0
offset_right = 590.0
offset_bottom = 351.0
bbcode_enabled = true

[node name="ConsoleOpenFolder" type="Button" parent="Console"]
offset_left = -4.0
offset_top = 360.0
offset_right = 604.0
offset_bottom = 401.0
text = "Open Output Folder"

[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 35.0
grow_horizontal = 2
color = Color(0.0646965, 0.0646965, 0.0646965, 1)

[node name="MenuBar" type="MenuBar" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_left = 8.0
offset_top = 4.0
offset_right = -8.0
offset_bottom = 35.0
grow_horizontal = 2
flat = true
prefer_global_menu = false

[node name="FileButton" type="PopupMenu" parent="MenuBar"]
title = "File"
item_count = 4
item_0/text = "New Thread"
item_0/id = 2
item_1/text = "Save Thread"
item_1/id = 3
item_2/text = "Save Thread As"
item_2/id = 0
item_3/text = "Load Thread"
item_3/id = 1

[node name="SettingsButton" type="PopupMenu" parent="MenuBar"]
title = "Settings"
item_count = 4
item_0/text = "Change CDP Folder Location"
item_0/id = 0
item_1/text = "Disable PVOC Multi Input Warning"
item_1/checkable = 1
item_1/id = 1
item_2/text = "Auto Close Console"
item_2/checkable = 1
item_2/id = 2
item_3/text = "Open the Console"
item_3/id = 3

[node name="HelpButton" type="PopupMenu" parent="MenuBar"]
auto_translate_mode = 1
title = "Help"
item_count = 8
item_0/text = "Tutorials"
item_0/id = 0
item_0/separator = true
item_1/text = "Getting Started"
item_1/id = 1
item_2/text = "Navigating SoundThread"
item_2/id = 2
item_3/text = "Building a Thread"
item_3/id = 3
item_4/text = "Frequency Domain"
item_4/id = 4
item_5/text = "SoundThread Quirks"
item_5/id = 5
item_6/text = "Other Help"
item_6/id = 6
item_6/separator = true
item_7/text = "CDP Documentation"
item_7/id = 7

[node name="About" type="PopupMenu" parent="MenuBar"]
item_count = 1
item_0/id = 0
item_0/disabled = true

[node name="SaveDialog" type="FileDialog" parent="."]
use_native_dialog = true

[node name="LoadDialog" type="FileDialog" parent="."]
auto_translate_mode = 1
use_native_dialog = true

[node name="SaveChangesPopup" type="Window" parent="." groups=["popup_windows"]]
auto_translate_mode = 1
title = "No Input Selected"
initial_position = 2
size = Vector2i(350, 100)
visible = false
transient = true
exclusive = true
unresizable = true
borderless = true
popup_window = true

[node name="Label" type="Label" parent="SaveChangesPopup"]
offset_left = -1.0
offset_top = 21.0
offset_right = 348.0
offset_bottom = 52.0
text = "Save changes to this thread?"
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2

[node name="SaveChanges" type="Button" parent="SaveChangesPopup"]
offset_left = -1.0
offset_top = 70.0
offset_right = 175.0
offset_bottom = 101.0
text = "Save"

[node name="DontSaveChanges" type="Button" parent="SaveChangesPopup"]
offset_left = 175.0
offset_top = 70.0
offset_right = 351.0
offset_bottom = 101.0
text = "Don't Save"

[connection signal="connection_request" from="GraphEdit" to="." method="_on_graph_edit_connection_request"]
[connection signal="delete_nodes_request" from="GraphEdit" to="." method="_on_graph_edit_delete_nodes_request"]
[connection signal="disconnection_request" from="GraphEdit" to="." method="_on_graph_edit_disconnection_request"]
[connection signal="node_deselected" from="GraphEdit" to="." method="_on_graph_edit_node_deselected"]
[connection signal="node_selected" from="GraphEdit" to="." method="_on_graph_edit_node_selected"]
[connection signal="dir_selected" from="FileDialog" to="." method="_on_file_dialog_dir_selected"]
[connection signal="meta_clicked" from="NoLocationPopup/RichTextLabel" to="." method="_on_rich_text_label_meta_clicked"]
[connection signal="button_down" from="NoLocationPopup/OkButton" to="." method="_on_ok_button_button_down"]
[connection signal="button_down" from="NoInputPopup/OkButton2" to="." method="_on_ok_button_2_button_down"]
[connection signal="button_down" from="MultipleConnectionsPopup/OkButton3" to="." method="_on_ok_button_3_button_down"]
[connection signal="canceled" from="CdpLocationDialog" to="." method="_on_cdp_location_dialog_canceled"]
[connection signal="dir_selected" from="CdpLocationDialog" to="." method="_on_cdp_location_dialog_dir_selected"]
[connection signal="close_requested" from="Console" to="." method="_on_console_close_requested"]
[connection signal="button_down" from="Console/ConsoleOpenFolder" to="." method="_on_console_open_folder_button_down"]
[connection signal="index_pressed" from="MenuBar/FileButton" to="." method="_on_file_button_index_pressed"]
[connection signal="index_pressed" from="MenuBar/SettingsButton" to="." method="_on_settings_button_index_pressed"]
[connection signal="index_pressed" from="MenuBar/HelpButton" to="." method="_on_help_button_index_pressed"]
[connection signal="file_selected" from="SaveDialog" to="." method="_on_save_dialog_file_selected"]
[connection signal="file_selected" from="LoadDialog" to="." method="_on_load_dialog_file_selected"]
[connection signal="button_down" from="SaveChangesPopup/SaveChanges" to="." method="_on_save_changes_button_down"]
[connection signal="button_down" from="SaveChangesPopup/DontSaveChanges" to="." method="_on_dont_save_changes_button_down"]
