Browse Source

Added support for stereo files and cleaning up intermediary files in the processing chain

Jonathan Higgins 7 months ago
parent
commit
aed6d38d09

+ 1 - 1
.godot/editor/audioplayer.tscn-editstate-5c5be15cd7cbde82fbc3248f6958ab76.cfg

@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 2 - 2
.godot/editor/control.tscn-editstate-475cf43e2d21753002d8a2b4ccf5105f.cfg

@@ -8,7 +8,7 @@ Anim={
 "grid_snap_active": false,
 "grid_step": Vector2(8, 8),
 "grid_visibility": 1,
-"ofs": Vector2(-376.133, -67.2406),
+"ofs": Vector2(-371.9, -83),
 "primary_grid_step": Vector2i(8, 8),
 "show_group_gizmos": true,
 "show_guides": true,
@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 1 - 1
.godot/editor/control.tscn-folding-475cf43e2d21753002d8a2b4ccf5105f.cfg

@@ -1,5 +1,5 @@
 [folding]
 
-node_unfolds=[NodePath("."), PackedStringArray("Layout")]
+node_unfolds=[NodePath("."), PackedStringArray("Layout"), NodePath("Console"), PackedStringArray("Flags"), NodePath("Console/ConsoleOutput"), PackedStringArray("Layout", "Layout/Transform")]
 resource_unfolds=[]
 nodes_folded=[]

+ 5 - 4
.godot/editor/create_recent.Node

@@ -1,5 +1,9 @@
-FileDialog
+Window
+Popup
+RichTextLabel
 Label
+CheckButton
+FileDialog
 VBoxContainer
 ScrollContainer
 Panel
@@ -9,6 +13,3 @@ AnimationPlayer
 Line2D
 TextureRect
 Button
-Window
-Popup
-AudioStreamPlayer

+ 1 - 1
.godot/editor/distortions.tscn-editstate-d5effea7e031baba994357d39ba6e749.cfg

@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 5 - 5
.godot/editor/editor_layout.cfg

@@ -9,7 +9,7 @@ dock_filesystem_v_split_offset=0
 dock_filesystem_display_mode=0
 dock_filesystem_file_sort=0
 dock_filesystem_file_list_display_mode=1
-dock_filesystem_selected_paths=PackedStringArray("res://")
+dock_filesystem_selected_paths=PackedStringArray("res://Global.gd")
 dock_filesystem_uncollapsed_paths=PackedStringArray("Favorites", "res://", "res://scenes/", "res://scenes/Nodes/", "res://scenes/menu/", "res://scenes/main/", "res://addons/", "res://addons/audio_preview/")
 dock_node_current_tab=0
 dock_history_include_scene=true
@@ -29,10 +29,10 @@ dock_5="Inspector,Node,History"
 [EditorNode]
 
 open_scenes=PackedStringArray("res://scenes/main/control.tscn", "res://distortions.tscn", "res://scenes/Nodes/valueslider.tscn", "res://scenes/Nodes/nodes.tscn", "res://scenes/menu/menu.tscn", "res://scenes/Nodes/audioplayer.tscn")
-current_scene="res://scenes/Nodes/nodes.tscn"
+current_scene="res://scenes/main/control.tscn"
 center_split_offset=0
 selected_default_debugger_tab_idx=0
-selected_main_editor_idx=0
+selected_main_editor_idx=2
 selected_bottom_panel_item=0
 
 [EditorWindow]
@@ -52,8 +52,8 @@ zoom_factor=1.0
 
 [GameView]
 
-floating_window_rect=Rect2i(0, 23, 1920, 1009)
-floating_window_screen=1
+floating_window_rect=Rect2i(2618, 175, 1164, 695)
+floating_window_screen=0
 
 [ShaderEditor]
 

+ 18 - 18
.godot/editor/filesystem_cache10

@@ -1,12 +1,12 @@
 ea4bc82a6ad023ab7ee23ee620429895
-::res://::1746500252
+::res://::1746530482
 clip.gd::GDScript/GDScript::4898173242493829381::1746186486::0::1::::<>GraphNode<><>0<>0<><>::
-clip_clip_2.gd::GDScript::5112891685983776275::1746492997::0::1::::<>GraphNode<><>0<>0<><>::
-config_handler.gd::GDScript::9123848664534566230::1746479238::0::1::::<>Node<><>0<>0<><>::
-distortions.tscn::PackedScene::2043500277826221405::1746499701::0::1::::<><><>0<>0<><>::uid://ce3ytxnt3y8dj::::res://clip_clip_2.gd<>uid://dya5kxx132fgp::::res://scenes/Nodes/valueslider.tscn
-Global.gd::GDScript::7717406573998402474::1746482136::0::1::::<>Node<><>0<>0<><>::
+clip_clip_2.gd::GDScript/GDScript::5112891685983776275::1746492997::0::1::::<>GraphNode<><>0<>0<><>::
+config_handler.gd::GDScript/GDScript::9123848664534566230::1746479238::0::1::::<>Node<><>0<>0<><>::
+distortions.tscn::PackedScene::2043500277826221405::1746500256::0::1::::<><><>0<>0<><>::uid://ce3ytxnt3y8dj::::res://clip_clip_2.gd<>uid://dya5kxx132fgp::::res://scenes/Nodes/valueslider.tscn
+Global.gd::GDScript/GDScript::7717406573998402474::1746482136::0::1::::<>Node<><>0<>0<><>::
 icon.svg::CompressedTexture2D/CompressedTexture2D::5168976688331411336::1745928495::1745928503::1::::<><><>0<>0<>5d9c9b5d6e3d90bedad9d000ed97534c<>res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex::
-README.md::TextFile::-1::1746495214::0::1::::<><><>0<>0<><>::
+README.md::TextFile/TextFile::-1::1746495214::0::1::::<><><>0<>0<><>::
 ::res://addons/::1746462377
 ::res://addons/audio_preview/::1746452824
 AudioStreamPreview.gd::GDScript/GDScript::2308550898442263711::1746444878::0::1::::<>TextureRect<><>0<>1<><>::
@@ -14,17 +14,17 @@ AudioStreamPreview.tscn::PackedScene/PackedScene::3762817095482496943::174645250
 voice_preview_generator.gd::GDScript/GDScript::6244997812245505292::1746444274::0::1::::<>Node<><>0<>1<><>::
 voice_preview_generator.tscn::PackedScene/PackedScene::6679166981814140597::1746444565::0::1::::<><><>0<>0<><>::uid://cu8eg4agw08xs::::res://addons/audio_preview/voice_preview_generator.gd
 ::res://scenes/::1746186301
-::res://scenes/main/::1746499701
-control.gd::GDScript::2620037524409541442::1746498159::0::1::::<>Control<><>0<>0<><>::
-control.tscn::PackedScene::2566019287410494992::1746499701::0::1::::<><><>0<>0<><>::uid://bdlfvuljckmu1::::res://scenes/main/control.gd<>uid://l2yejnjysupr::::res://scenes/main/graph_edit.gd<>uid://b0wdj8v6o0wq0::::res://scenes/menu/menu.tscn
+::res://scenes/main/::1746500256
+control.gd::GDScript/GDScript::2620037524409541442::1746498159::0::1::::<>Control<><>0<>0<><>::
+control.tscn::PackedScene::2566019287410494992::1746500256::0::1::::<><><>0<>0<><>::uid://bdlfvuljckmu1::::res://scenes/main/control.gd<>uid://l2yejnjysupr::::res://scenes/main/graph_edit.gd<>uid://b0wdj8v6o0wq0::::res://scenes/menu/menu.tscn
 graph_edit.gd::GDScript/GDScript::829280323614315599::1746182218::0::1::::<>GraphEdit<><>0<>0<><>::
-::res://scenes/menu/::1746499702
-menu.tscn::PackedScene::4186758075496332121::1746499702::0::1::::<><><>0<>0<><>::
-::res://scenes/Nodes/::1746499702
-audioplayer.gd::GDScript::5570864814132306429::1746476799::0::1::::<>Control<><>0<>0<><>::
-audioplayer.tscn::PackedScene::6037166449976350293::1746499702::0::1::::<><><>0<>0<><>::uid://clmtlg8via3qn::::res://scenes/Nodes/audioplayer.gd
-focus_accu_sliders.gd::GDScript::8821949764991756997::1746492997::0::1::::<>GraphNode<><>0<>0<><>::
-nodes.tscn::PackedScene::8614413456730569426::1746499702::0::1::::<><><>0<>0<><>::uid://ce3ytxnt3y8dj::::res://clip_clip_2.gd<>uid://csapiqka522fh::::res://scenes/Nodes/audioplayer.tscn<>uid://dya5kxx132fgp::::res://scenes/Nodes/valueslider.tscn<>uid://dxxohuvlw5e3n::::res://scenes/Nodes/focus_accu_sliders.gd
+::res://scenes/menu/::1746500256
+menu.tscn::PackedScene::4186758075496332121::1746500256::0::1::::<><><>0<>0<><>::
+::res://scenes/Nodes/::1746500257
+audioplayer.gd::GDScript/GDScript::5570864814132306429::1746476799::0::1::::<>Control<><>0<>0<><>::
+audioplayer.tscn::PackedScene::6037166449976350293::1746500257::0::1::::<><><>0<>0<><>::uid://clmtlg8via3qn::::res://scenes/Nodes/audioplayer.gd
+focus_accu_sliders.gd::GDScript/GDScript::8821949764991756997::1746492997::0::1::::<>GraphNode<><>0<>0<><>::
+nodes.tscn::PackedScene::8614413456730569426::1746500256::0::1::::<><><>0<>0<><>::uid://ce3ytxnt3y8dj::::res://clip_clip_2.gd<>uid://csapiqka522fh::::res://scenes/Nodes/audioplayer.tscn<>uid://dya5kxx132fgp::::res://scenes/Nodes/valueslider.tscn<>uid://dxxohuvlw5e3n::::res://scenes/Nodes/focus_accu_sliders.gd
 valueslider.gd::GDScript/GDScript::2557655848205010713::1746187131::0::1::::<>VBoxContainer<><>0<>0<><>::
-valueslider.tscn::PackedScene::8845634910901483783::1746499702::0::1::::<><><>0<>0<><>::uid://bco7hof3wqck4::::res://scenes/Nodes/valueslider.gd
-waveform_preview.gd::GDScript::5688062150584079786::1746458041::0::1::::<>Control<><>0<>0<><>::
+valueslider.tscn::PackedScene::8845634910901483783::1746500256::0::1::::<><><>0<>0<><>::uid://bco7hof3wqck4::::res://scenes/Nodes/valueslider.gd
+waveform_preview.gd::GDScript/GDScript::5688062150584079786::1746458041::0::1::::<>Control<><>0<>0<><>::

+ 3 - 0
.godot/editor/filesystem_update4

@@ -4,3 +4,6 @@ res://scenes/Nodes/valueslider.tscn
 res://scenes/Nodes/nodes.tscn
 res://scenes/menu/menu.tscn
 res://scenes/Nodes/audioplayer.tscn
+res://scenes/main/control.gd
+res://scenes/Nodes/audioplayer.gd
+res://Global.gd

+ 1 - 1
.godot/editor/menu.tscn-editstate-523ba9f1be4474a87fc09942b9fbb098.cfg

@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 1 - 1
.godot/editor/nodes.tscn-editstate-d18a50cdbd65798e64eea9469be45949.cfg

@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 7 - 11
.godot/editor/script_editor_cache.cfg

@@ -21,11 +21,11 @@ state={
 state={
 "bookmarks": PackedInt32Array(),
 "breakpoints": PackedInt32Array(),
-"column": 101,
+"column": 0,
 "folded_lines": Array[int]([]),
 "h_scroll_position": 0,
-"row": 180,
-"scroll_position": 0.0,
+"row": 175,
+"scroll_position": 159.0,
 "selection": false,
 "syntax_highlighter": "GDScript"
 }
@@ -81,16 +81,12 @@ state={
 state={
 "bookmarks": PackedInt32Array(),
 "breakpoints": PackedInt32Array(),
-"column": 22,
+"column": 20,
 "folded_lines": Array[int]([]),
 "h_scroll_position": 0,
-"row": 51,
+"row": 49,
 "scroll_position": 0.0,
-"selection": true,
-"selection_from_column": 2,
-"selection_from_line": 51,
-"selection_to_column": 22,
-"selection_to_line": 51,
+"selection": false,
 "syntax_highlighter": "GDScript"
 }
 
@@ -148,7 +144,7 @@ state={
 "column": 0,
 "folded_lines": Array[int]([]),
 "h_scroll_position": 0,
-"row": 4,
+"row": 5,
 "scroll_position": 0.0,
 "selection": false,
 "syntax_highlighter": "GDScript"

+ 1 - 1
.godot/editor/valueslider.tscn-editstate-d535ab38e866eae88d73c3fd55232f95.cfg

@@ -192,4 +192,4 @@ Game={
 "hide_selection": false,
 "select_mode": 0
 }
-selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control")])
+selected_nodes=Array[NodePath]([NodePath("/root/@EditorNode@21272/@Panel@14/@VBoxContainer@15/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@26/DockVSplitCenter/@VSplitContainer@54/@VBoxContainer@55/@EditorMainScreen@102/MainScreen/@CanvasItemEditor@11482/@VSplitContainer@11134/@HSplitContainer@11136/@HSplitContainer@11138/@Control@11139/@SubViewportContainer@11140/@SubViewport@11141/Control/Console")])

+ 1 - 0
Global.gd

@@ -1,4 +1,5 @@
 extends Node
 
 var infile = "no_file"
+var infile_stereo = false
 var outfile = "no_file"

+ 7 - 7
scenes/Nodes/audioplayer.gd

@@ -44,13 +44,13 @@ func _on_load_button_button_down() -> void:
 
 func _on_file_selected(path: String):
 	audio_player.stream = AudioStreamWAV.load_from_file(path)
-	if audio_player.stream.stereo == true:
-		audio_player.stream = null
-		$WavError.show()
-	else:
-		voice_preview_generator.generate_preview(audio_player.stream)
-		Global.infile = path
-		print(Global.infile)
+	Global.infile_stereo = audio_player.stream.stereo
+	#if audio_player.stream.stereo == true:
+		##audio_player.stream = null
+		##$WavError.show()
+	voice_preview_generator.generate_preview(audio_player.stream)
+	Global.infile = path
+	print(Global.infile)
 
 func _on_play_button_button_down() -> void:
 	if audio_player.stream:

+ 196 - 119
scenes/main/control.gd

@@ -5,6 +5,8 @@ var effect_position = Vector2(40,40) #tracks mouse position for node placement o
 @onready var graph_edit = $GraphEdit
 var selected_nodes = {} #used to track which nodes in the GraphEdit are selected
 var cdpprogs_location
+var delete_intermediate_outputs
+@onready var console_output: RichTextLabel = $Console/ConsoleOutput
 
 # Called when the node enters the scene tree for the first time.
 func _ready() -> void:
@@ -12,6 +14,8 @@ func _ready() -> void:
 	Nodes.hide()
 	$mainmenu.hide()
 	$NoLocationPopup.hide()
+	$DeleteIntermediateFilesToggle.button_pressed = true
+	$Console.hide()
 	
 	#Goes through all nodes in scene and checks for buttons in the make_node_buttons group
 	#Associates all buttons with the _on_button_pressed fuction and passes the button as an argument
@@ -92,7 +96,7 @@ func _on_graph_edit_node_deselected(node: Node) -> void:
 
 func _on_graph_edit_delete_nodes_request(nodes: Array[StringName]) -> void:
 	for node in selected_nodes.keys():
-		if selected_nodes[node]:
+		if selected_nodes[node] and node.name != "inputfile":
 			remove_connections_to_node(node)
 			node.queue_free()
 	selected_nodes = {}
@@ -109,6 +113,9 @@ func _on_generate_batch_file_button_down() -> void:
 	$FileDialog.show()
 
 func _on_file_dialog_dir_selected(dir: String) -> void:
+	$Console.show()
+	console_output.append_text("Generating processing queue\n")
+	await get_tree().process_frame
 	#get the current time in hh-mm-ss format as default : causes file name issues
 	var time_dict = Time.get_time_dict_from_system()
 	# Pad with zeros to ensure two digits for hour, minute, second
@@ -117,6 +124,8 @@ func _on_file_dialog_dir_selected(dir: String) -> void:
 	var second = str(time_dict.second).pad_zeros(2)
 	var time_str = hour + "-" + minute + "-" + second
 	Global.outfile = dir + "/outfile_" + Time.get_date_string_from_system() + "_" + time_str
+	console_output.append_text("Output directory and file name(s):" + Global.outfile + "\n")
+	await get_tree().process_frame
 	
 	generate_batch_file_ordered_with_multiple_sliders()
 
@@ -160,127 +169,165 @@ func generate_batch_file_ordered_with_multiple_sliders():
 				queue.append(neighbor)
 
 	if sorted.size() != nodes.size():
+		console_output.append_text("Cycle detected in graph or disconnected nodes\n")
+		await get_tree().process_frame
 		push_error("Cycle detected in graph or disconnected nodes.")
 		return
 
 	# Step 4: Generate batch lines
+	console_output.append_text("Generating process queue from " + str(sorted.size()) + " nodes\n" )
+	await get_tree().process_frame
 	var batch_lines: Array[String] = []
-	var current_infile: String = Global.infile
-
-	for i in sorted.size():
-		var node_name = sorted[i]
-		var node = graph_edit.get_node(NodePath(node_name))
-		var slider_data = _get_slider_values_ordered(node)
-
-		# Get slot type to determine file extension
-		var output_slot_type: int = node.get_slot_type_right(0)
-		var extension := ".wav"
-		if output_slot_type == 1:
-			extension = ".ana"
-
-		var command_name: String = str(node.get_meta("command")) if node.has_meta("command") else node_name
-		command_name = command_name.replace("_", " ")
-		var outfile_numbered: String = Global.outfile.get_basename() + "_%d%s" % [i, extension]
-
-		# Build the batch line
-		var line: String = cdpprogs_location + "/" + command_name + " \"" + current_infile + "\" \"" + outfile_numbered + "\" "
-
-		for entry in slider_data:
-			var slider_name = entry[0]
-			var value = entry[1]
-			if slider_name.begins_with("-"):
-				line += "%s%.2f " % [slider_name, float(value)]
-			else:
-				line += "%.2f " % float(value)
+	var intermediate_files: Array[String] = []
 
-		batch_lines.append(line.strip_edges())
-		current_infile = outfile_numbered  # Pass this as next step's input
+	var process_count = 0
+	
+	if Global.infile_stereo:
+		# Stereo processing
+		var stereo_base := Global.infile.get_basename()
+		var infile_c1 := stereo_base + "_c1.wav"
+		var infile_c2 := stereo_base + "_c2.wav"
+		var outfile_c1 := ""
+		var outfile_c2 := ""
+
+		console_output.append_text("Input file is stereo, adding split to dual mono to process queue, this may cause stereo decorrolation with some processess\n")
+		await get_tree().process_frame
+		# Add stereo split processing command
+		batch_lines.append(cdpprogs_location + "/housekeep chans 2 \"" + Global.infile + "\"")
+
+		# Process both channels (c1 and c2)
+		for channel in ["c1", "c2"]:
+			var current_infile := stereo_base + "_%s.wav" % channel
+			for i in sorted.size():
+				var node_name = sorted[i]
+				var node = graph_edit.get_node(NodePath(node_name))
+				var slider_data = _get_slider_values_ordered(node)
+
+				# Get output type and file extension
+				var output_slot_type: int = node.get_slot_type_right(0)
+				var extension := ".wav"
+				if output_slot_type == 1:
+					extension = ".ana"
+
+				# Generate command
+				var command_name: String = str(node.get_meta("command")) if node.has_meta("command") else node_name
+				command_name = command_name.replace("_", " ")
+
+				var outfile_numbered := Global.outfile.get_basename() + "_%s_%d%s" % [channel, i, extension]
+				var line: String = cdpprogs_location + "/" + command_name + " \"" + current_infile + "\" \"" + outfile_numbered + "\" "
+
+				# Add slider values to the command
+				for entry in slider_data:
+					var slider_name = entry[0]
+					var value = entry[1]
+					if slider_name.begins_with("-"):
+						line += "%s%.2f " % [slider_name, float(value)]
+					else:
+						line += "%.2f " % float(value)
+
+				batch_lines.append(line.strip_edges())
+				console_output.append_text("Added process to queue:" + line.strip_edges() + "\n")
+				
+				
+				# Add output file to delete list
+				if process_count < sorted.size() - 1 and delete_intermediate_outputs:
+					intermediate_files.append(outfile_numbered)
+				process_count += 1
+				current_infile = outfile_numbered
+			
+			#reset count for right channel
+			process_count = 0
+			
+			# Keep track of the last output for each channel
+			if channel == "c1":
+				outfile_c1 = current_infile
+			else:
+				outfile_c2 = current_infile
+				
+		await get_tree().process_frame
+		# Final interleave if both branches ended in .wav
+		if outfile_c1.ends_with(".wav") and outfile_c2.ends_with(".wav"):
+			batch_lines.append(cdpprogs_location + "/submix interleave \"" + outfile_c1 + "\" \"" + outfile_c2 + "\" \"" + Global.outfile + "_stereo.wav\"")
+			# Conditionally add output files from stereo processing
+			if delete_intermediate_outputs:
+				intermediate_files.append(outfile_c1)
+				intermediate_files.append(outfile_c2)
+			console_output.append_text("Added process to queue to recombine dual mono output to stereo. Stereo output file is:" + Global.outfile +"_stereo.wav\n")
+			await get_tree().process_frame
+		# Always add stereo split files (_c1 and _c2) for cleanup
+		intermediate_files.append(infile_c1)
+		intermediate_files.append(infile_c2)
 
-	# Step 5: Write file
+	else:
+		# Mono processing
+		var current_infile: String = Global.infile
+		console_output.append_text("Input file is mono\n")
+		await get_tree().process_frame
+		
+		for i in sorted.size():
+			var node_name = sorted[i]
+			var node = graph_edit.get_node(NodePath(node_name))
+			var slider_data = _get_slider_values_ordered(node)
+
+			# Get output type and file extension
+			var output_slot_type: int = node.get_slot_type_right(0)
+			var extension := ".wav"
+			if output_slot_type == 1:
+				extension = ".ana"
+
+			# Generate command
+			var command_name: String = str(node.get_meta("command")) if node.has_meta("command") else node_name
+			command_name = command_name.replace("_", " ")
+			var outfile_numbered: String = Global.outfile.get_basename() + "_%d%s" % [i, extension]
+
+			var line: String = cdpprogs_location + "/" + command_name + " \"" + current_infile + "\" \"" + outfile_numbered + "\" "
+			
+			
+			# Add slider values to the command
+			for entry in slider_data:
+				var slider_name = entry[0]
+				var value = entry[1]
+				if slider_name.begins_with("-"):
+					line += "%s%.2f " % [slider_name, float(value)]
+				else:
+					line += "%.2f " % float(value)
+
+			batch_lines.append(line.strip_edges())
+			console_output.append_text("Added process to queue:" + line.strip_edges() + "\n")
+			
+			# Add output file to delete list if needed
+			if process_count < sorted.size() - 1 and delete_intermediate_outputs:
+				intermediate_files.append(outfile_numbered)
+			process_count += 1
+			current_infile = outfile_numbered
+	
+	await get_tree().process_frame
+	
+	# Step 5: Clean up intermediate files (skip the last one)
+	if intermediate_files.size() >= 1:
+		console_output.append_text("Adding processes to clean up intermediate files leaving only the final output file\n")
+		await get_tree().process_frame
+		var last_drive_letter := ""
+		for i in intermediate_files.size(): 
+			var file_path := intermediate_files[i].replace("/", "\\")
+			var drive_letter := file_path.substr(0, 2)
+			if drive_letter != last_drive_letter:
+				batch_lines.append(drive_letter)
+				last_drive_letter = drive_letter
+			batch_lines.append("del \"%s\"" % file_path)
+	
+	
+	# Step 6: Write file
 	var file = FileAccess.open("user://ordered_script.bat", FileAccess.WRITE)
 	for line in batch_lines:
 		file.store_line(line)
 	file.close()
 
 	print("Batch file written to user://ordered_script.bat")
+	console_output.append_text("[color=green]Building process queue is complete[/color]\n")
+	console_output.append_text("Running process, please wait...\n")
+	await get_tree().process_frame
 	run_batch_file()
-#func generate_batch_file_ordered_with_multiple_sliders():
-	#var connections = graph_edit.get_connection_list()
-	#var graph := {}
-	#var indegree := {}
-	#var nodes := []
-#
-	## Step 1: Collect relevant nodes
-	#for child in graph_edit.get_children():
-		#if child is GraphNode:
-			#var name = str(child.name)
-			#if name == "inputfile" or name == "outputfile":
-				#continue
-			#graph[name] = []
-			#indegree[name] = 0
-			#nodes.append(name)
-#
-	## Step 2: Build graph
-	#for conn in connections:
-		#var from = str(conn["from_node"])
-		#var to = str(conn["to_node"])
-		#if graph.has(from) and graph.has(to):
-			#graph[from].append(to)
-			#indegree[to] += 1
-#
-	## Step 3: Topological sort
-	#var sorted := []
-	#var queue := []
-	#for node in nodes:
-		#if indegree[node] == 0:
-			#queue.append(node)
-#
-	#while not queue.is_empty():
-		#var current = queue.pop_front()
-		#sorted.append(current)
-		#for neighbor in graph[current]:
-			#indegree[neighbor] -= 1
-			#if indegree[neighbor] == 0:
-				#queue.append(neighbor)
-#
-	#if sorted.size() != nodes.size():
-		#push_error("Cycle detected in graph or disconnected nodes.")
-		#return
-#
-	## Step 4: Generate batch lines
-	#var batch_lines: Array[String] = []
-	#var current_infile: String = Global.infile
-#
-	#for i in sorted.size():
-		#var node_name = sorted[i]
-		#var node = graph_edit.get_node(NodePath(node_name))
-		#var slider_data = _get_slider_values_ordered(node)
-#
-		#var node_name_spaced: String = node_name.replace("_", " ")
-		#var outfile_numbered: String = Global.outfile.get_basename() + "_%d.wav" % i
-#
-		#var line: String = cdpprogs_location + "/" + node_name_spaced + " \"" + current_infile + "\" \"" + outfile_numbered + "\" "
-#
-		#for entry in slider_data:
-			#var slider_name = entry[0]
-			#var value = entry[1]
-			#if slider_name.begins_with("-"):
-				#line += "%s %.2f " % [slider_name, float(value)]
-			#else:
-				#line += "%.2f " % float(value)
-#
-		#batch_lines.append(line.strip_edges())
-		#current_infile = outfile_numbered  # Use this as next step's inputes())
-#
-	## Step 5: Write file
-	#var file = FileAccess.open("user://ordered_script.bat", FileAccess.WRITE)
-	#for line in batch_lines:
-		#file.store_line(line)
-	#file.close()
-#
-	#print("Batch file written to user://ordered_script.bat")
-	#run_batch_file()
-
 
 # Ordered slider collection
 func _get_slider_values_ordered(node: Node) -> Array:
@@ -295,27 +342,57 @@ func _get_slider_values_ordered(node: Node) -> Array:
 	
 func run_batch_file():
 	var bat_path = ProjectSettings.globalize_path("user://ordered_script.bat")
-
-	# Create empty arrays to capture the output and error
 	var output : Array = []
 	var error : Array = []
 
-	# Execute the batch file and capture output and error
 	var exit_code = OS.execute("cmd.exe", ["/c", bat_path], output, true, true)
 
-	# Manually join the array elements into a single string
 	var output_str = ""
 	for item in output:
-		output_str += item + "\n"  # Append each element with a newline
+		output_str += item + "\n"
 
 	var error_str = ""
 	for item in error:
-		error_str += item + "\n"  # Append each element with a newline
+		error_str += item + "\n"
 
-	# Output handling based on exit code
 	if exit_code == 0:
-		print("Batch file ran successfully.")
-		print("Output: ", output_str)
+		console_output.append_text("[color=green]Processes ran successfully[/color]\n")
+		console_output.append_text("[b]Output:[/b]\n" + output_str)
 	else:
-		print("Batch file failed with exit code:", exit_code)
-		print("Error: ", error_str)
+		console_output.append_text("[color=red][b]Processes failed with exit code: %d[/b][/color]\n" % exit_code)
+		console_output.append_text("[b]Error:[/b]\n" + error_str)
+#func run_batch_file():
+	#var bat_path = ProjectSettings.globalize_path("user://ordered_script.bat")
+#
+	## Create empty arrays to capture the output and error
+	#var output : Array = []
+	#var error : Array = []
+#
+	## Execute the batch file and capture output and error
+	#var exit_code = OS.execute("cmd.exe", ["/c", bat_path], output, true, true)
+#
+	## Manually join the array elements into a single string
+	#var output_str = ""
+	#for item in output:
+		#output_str += item + "\n"  # Append each element with a newline
+#
+	#var error_str = ""
+	#for item in error:
+		#error_str += item + "\n"  # Append each element with a newline
+#
+	## Output handling based on exit code
+	#if exit_code == 0:
+		#print("Processes ran successfully.")
+		#print("Output: ", output_str)
+	#else:
+		#print("Processes failed with exit code:", exit_code)
+		#print("Error: ", error_str)
+
+
+
+func _on_delete_intermediate_files_toggle_toggled(toggled_on: bool) -> void:
+	delete_intermediate_outputs = toggled_on
+
+
+func _on_console_close_requested() -> void:
+	$Console.hide()

+ 30 - 0
scenes/main/control.tscn

@@ -84,6 +84,34 @@ file_mode = 2
 access = 2
 use_native_dialog = true
 
+[node name="Label" type="Label" parent="."]
+layout_mode = 0
+offset_left = 231.0
+offset_top = 604.0
+offset_right = 423.0
+offset_bottom = 627.0
+text = "Delete intermediate files"
+
+[node name="DeleteIntermediateFilesToggle" type="CheckButton" parent="."]
+layout_mode = 0
+offset_left = 184.0
+offset_top = 606.0
+offset_right = 228.0
+offset_bottom = 630.0
+
+[node name="Console" type="Window" parent="."]
+initial_position = 5
+size = Vector2i(600, 400)
+visible = false
+always_on_top = true
+
+[node name="ConsoleOutput" type="RichTextLabel" parent="Console"]
+offset_left = 10.0
+offset_top = 10.0
+offset_right = 590.0
+offset_bottom = 390.0
+bbcode_enabled = true
+
 [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"]
@@ -94,3 +122,5 @@ use_native_dialog = true
 [connection signal="button_down" from="NoLocationPopup/OkButton" to="." method="_on_ok_button_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="toggled" from="DeleteIntermediateFilesToggle" to="." method="_on_delete_intermediate_files_toggle_toggled"]
+[connection signal="close_requested" from="Console" to="." method="_on_console_close_requested"]