Forráskód Böngészése

small bug fixes for console errors

Jonathan Higgins 2 hónapja
szülő
commit
acf41c8b01

+ 5 - 7
Global/Global.gd

@@ -23,11 +23,9 @@ func check_for_invalid_chars(file: String) -> Dictionary:
 		if string != "":
 			var result = regex.search_all(string)
 			for matches in result:
-				var char = matches.get_string()
-				if invalid_chars.has(char) == false:
-					invalid_chars.append(char)
-
-	var invalid_string = "".join(invalid_chars)
+				var character = matches.get_string()
+				if invalid_chars.has(character) == false:
+					invalid_chars.append(character)
 	
 	if invalid_chars.size() == 0:
 		output["contains_invalid_characters"] = false
@@ -35,7 +33,7 @@ func check_for_invalid_chars(file: String) -> Dictionary:
 		output["contains_invalid_characters"] = true
 		output["invalid_characters_found"] = invalid_chars
 		var cleaned_string = file
-		for char in invalid_chars:
-			cleaned_string = cleaned_string.replace(char, "")
+		for character in invalid_chars:
+			cleaned_string = cleaned_string.replace(character, "")
 		output["string_without_invalid_characters"] = cleaned_string
 	return output

+ 4 - 5
scenes/Nodes/node_logic.gd

@@ -128,17 +128,16 @@ func _randomise_sliders():
 	var sliders := _get_all_hsliders(self) #finds all sliders
 	#links sliders to this script
 	for slider in sliders:
-		var min = slider.min_value
-		var max = slider.max_value
+		var minimum = slider.min_value
+		var maximum = slider.max_value
 		var expo = slider.exp_edit
-		var default = slider.get_meta("default_value")
 		
 		var rnd = randf()
 		var rnd_value
 		if expo:
-			rnd_value = min * pow(max / min, rnd)
+			rnd_value = minimum * pow(maximum / minimum, rnd)
 		else:
-			rnd_value = (rnd * (max - min)) + min
+			rnd_value = (rnd * (maximum - minimum)) + minimum
 		
 		slider.value = rnd_value
 	

+ 18 - 19
scenes/main/scripts/control.gd

@@ -184,24 +184,24 @@ func new_patch():
 func link_output():
 	#links various buttons and function in the input nodes - this is called after they are created so that it still works on new and loading files
 	for control in get_tree().get_nodes_in_group("outputnode"): #check all items in outputnode group
-		#if control.has_meta("outputfunciton"):
-		if control.get_meta("outputfunction") == "deleteintermediate": #link delete intermediate files toggle to script
-			control.toggled.connect(_toggle_delete)
-			_toggle_delete(control.button_pressed)
-			#control.button_pressed = interface_settings.get("delete_intermediate", true)
-
-		elif control.get_meta("outputfunction") == "runprocess": #link runprocess button
-			control.button_down.connect(_run_process)
-		elif control.get_meta("outputfunction") == "audioplayer": #link output audio player
-			output_audio_player = control
-		elif control.get_meta("outputfunction") == "filename":
-			control.text = "outfile"
-			outfilename = control
-		elif control.get_meta("outputfunction") == "reusefolder":
-			foldertoggle = control
-			#foldertoggle.button_pressed = interface_settings.get("reuse_output_folder", true)
-		elif control.get_meta("outputfunction") == "openfolder":
-			control.button_down.connect(_open_output_folder)
+		if control.has_meta("outputfunction"):
+			if control.get_meta("outputfunction") == "deleteintermediate": #link delete intermediate files toggle to script
+				control.toggled.connect(_toggle_delete)
+				_toggle_delete(control.button_pressed)
+				#control.button_pressed = interface_settings.get("delete_intermediate", true)
+
+			elif control.get_meta("outputfunction") == "runprocess": #link runprocess button
+				control.button_down.connect(_run_process)
+			elif control.get_meta("outputfunction") == "audioplayer": #link output audio player
+				output_audio_player = control
+			elif control.get_meta("outputfunction") == "filename":
+				control.text = "outfile"
+				outfilename = control
+			elif control.get_meta("outputfunction") == "reusefolder":
+				foldertoggle = control
+				#foldertoggle.button_pressed = interface_settings.get("reuse_output_folder", true)
+			elif control.get_meta("outputfunction") == "openfolder":
+				control.button_down.connect(_open_output_folder)
 
 
 	#for control in get_tree().get_nodes_in_group("inputnode"):
@@ -441,7 +441,6 @@ func _on_ok_button_3_button_down() -> void:
 
 
 func _on_settings_button_index_pressed(index: int) -> void:
-	var interface_settings = ConfigHandler.load_interface_settings()
 	
 	match index:
 		0:

+ 4 - 4
scenes/main/scripts/graph_edit.gd

@@ -139,8 +139,8 @@ func _make_node(command: String, skip_undo_redo := false) -> GraphNode:
 						var brk = param_data.get("automatable", false)
 						var time = param_data.get("time", false)
 						var outputduration = param_data.get("outputduration", false)
-						var min = param_data.get("min", false)
-						var max = param_data.get("max", false)
+						var minimum = param_data.get("min", false)
+						var maximum = param_data.get("max", false)
 						var flag = param_data.get("flag", "")
 						var fftwindowsize = param_data.get("fftwindowsize", false)
 						var fftwindowcount = param_data.get("fftwindowcount", false)
@@ -161,8 +161,8 @@ func _make_node(command: String, skip_undo_redo := false) -> GraphNode:
 						var hslider = slider.get_node("HSplitContainer/HSlider")
 						hslider.set_meta("brk", brk)
 						hslider.set_meta("time", time)
-						hslider.set_meta("min", min)
-						hslider.set_meta("max", max)
+						hslider.set_meta("min", minimum)
+						hslider.set_meta("max", maximum)
 						hslider.set_meta("flag", flag)
 						hslider.set_meta("default_value", value)
 						hslider.set_meta("fftwindowsize", fftwindowsize)

+ 2 - 2
scenes/main/scripts/open_help.gd

@@ -41,11 +41,11 @@ func show_help_for_node(node_name: String, node_title: String):
 			output += "[cell][b]Parameter Name[/b][/cell][cell][b]Description[/b][/cell][cell][b]Automatable[/b][/cell]\n"
 			for key in parameters.keys(): #scans through all parameters
 				var param = parameters[key]
-				var name = param.get("paramname", "")
+				var paramname = param.get("paramname", "")
 				var desc = param.get("paramdescription", "")
 				var automatable = param.get("automatable", false)
 				var autom_text = "[center]✓[/center]" if automatable else "[center]𐄂[/center]" #replaces true and false with ticks and crosses
-				output += "[cell]%s[/cell][cell]%s[/cell][cell]%s[/cell]\n" % [name, desc, autom_text] #places each param detail into cells of the table
+				output += "[cell]%s[/cell][cell]%s[/cell][cell]%s[/cell]\n" % [paramname, desc, autom_text] #places each param detail into cells of the table
 			output += "[/table]\n\n" #ends the table
 		
 		output += "[b]Functionality[/b]\n"

+ 14 - 16
scenes/main/scripts/run_thread.gd

@@ -43,7 +43,6 @@ func run_thread_with_branches():
 	# Choose appropriate commands based on OS
 	var delete_cmd = "del" if is_windows else "rm"
 	var rename_cmd = "ren" if is_windows else "mv"
-	var path_sep := "/"  # Always use forward slash for paths
 
 	# Get all node connections in the GraphEdit
 	var connections = graph_edit.get_connection_list()
@@ -140,7 +139,6 @@ func run_thread_with_branches():
 	#check if input file sample rates and bit depths match
 	if input_nodes.size() > 1:
 		var match_input_files = await match_input_file_sample_rates_and_bit_depths(input_nodes)
-		var stereo = []
 		if control_script.delete_intermediate_outputs:
 			for f in match_input_files[0]:
 				intermediate_files.append(f)
@@ -379,7 +377,7 @@ func run_thread_with_branches():
 				process_count += 1
 			else: #not an audio file must be synthesis
 				var slider_data = _get_slider_values_ordered(node)
-				var makeprocess = await make_process(node, process_count, [], slider_data)
+				var makeprocess = make_process(node, process_count, [], slider_data)
 				# run the command
 				await run_command(makeprocess[0], makeprocess[3])
 				await get_tree().process_frame
@@ -426,7 +424,7 @@ func run_thread_with_branches():
 						
 					output_files[node_name] = pvoc_stereo_files
 				else:
-					var input_stereo = await is_stereo(current_infiles.values()[0])
+					var input_stereo = is_stereo(current_infiles.values()[0])
 					if input_stereo == true: 
 						#audio file is stereo and needs to be split for pvoc processing
 						var pvoc_stereo_files = []
@@ -458,7 +456,7 @@ func run_thread_with_branches():
 						
 					else: 
 						#input file is mono run through process
-						var makeprocess = await make_process(node, process_count, current_infiles.values(), slider_data)
+						var makeprocess = make_process(node, process_count, current_infiles.values(), slider_data)
 						# run the command
 						await run_command(makeprocess[0], makeprocess[3])
 						await get_tree().process_frame
@@ -510,12 +508,12 @@ func run_thread_with_branches():
 						intermediate_files.erase(preview_file)
 				else:
 					#Detect if input file is mono or stereo
-					var input_stereo = await is_stereo(current_infiles.values()[0])
+					var input_stereo = is_stereo(current_infiles.values()[0])
 					#var input_stereo = true #bypassing stereo check just for testing need to reimplement
 					if input_stereo == true:
 						if node.get_meta("stereo_input") == true: #audio file is stereo and process is stereo, run file through process
 							#current_infile = current_infiles.values()
-							var makeprocess = await make_process(node, process_count, current_infiles.values(), slider_data)
+							var makeprocess = make_process(node, process_count, current_infiles.values(), slider_data)
 							# run the command
 							await run_command(makeprocess[0], makeprocess[3])
 							await get_tree().process_frame
@@ -565,7 +563,7 @@ func run_thread_with_branches():
 								intermediate_files.append(output_file)
 
 					else: #audio file is mono, run through the process
-						var makeprocess = await make_process(node, process_count, current_infiles.values(), slider_data)
+						var makeprocess = make_process(node, process_count, current_infiles.values(), slider_data)
 						# run the command
 						await run_command(makeprocess[0], makeprocess[3])
 						await get_tree().process_frame
@@ -680,7 +678,7 @@ func stereo_split_and_process(files: Array, node: Node, process_count: int, slid
 	
 	#loop through the left and right arrays and make and run the process for each of them
 	for channel in [left, right]:
-		var makeprocess = await make_process(node, process_count, channel, slider_data)
+		var makeprocess = make_process(node, process_count, channel, slider_data)
 		# run the command
 		await run_command(makeprocess[0], makeprocess[3])
 		await get_tree().process_frame
@@ -709,7 +707,7 @@ func process_dual_mono_pvoc(current_infiles: Dictionary, node: Node, process_cou
 		infiles_right.append(value[1])
 		
 	for infiles in [infiles_left, infiles_right]:
-		var makeprocess = await make_process(node, process_count, infiles, slider_data)
+		var makeprocess = make_process(node, process_count, infiles, slider_data)
 		# run the command
 		await run_command(makeprocess[0], makeprocess[3])
 		await get_tree().process_frame
@@ -1034,7 +1032,7 @@ func match_file_channels(inlet_id: int, process_count: int, input_files: Array)
 	
 	# Check each file's channel count and build channel count array
 	for f in input_files:
-		var stereo = await is_stereo(f)
+		var stereo = is_stereo(f)
 		channel_counts.append(stereo)
 
 	# Check if there is a mix of mono and stereo files
@@ -1074,7 +1072,7 @@ func _get_slider_values_ordered(node: Node) -> Array:
 			var brk_data = []
 			var min_slider = child.min_value
 			var max_slider = child.max_value
-			var exp = child.exp_edit
+			var exponential = child.exp_edit
 			var fftwindowsize = child.get_meta("fftwindowsize")
 			var fftwindowcount = child.get_meta("fftwindowcount")
 			var value = child.value
@@ -1089,7 +1087,7 @@ func _get_slider_values_ordered(node: Node) -> Array:
 					value = max(int(fft_size * (value/100)), 1)
 				min_slider = max(int(fft_size * (min_slider/100)), 1)
 				max_slider = int(fft_size * (max_slider/100))
-			results.append(["slider", flag, value, time, brk_data, min_slider, max_slider, exp, fftwindowcount])
+			results.append(["slider", flag, value, time, brk_data, min_slider, max_slider, exponential, fftwindowcount])
 		elif child is CheckButton:
 			var flag = child.get_meta("flag") if child.has_meta("flag") else ""
 			results.append(["checkbutton", flag, child.button_pressed])
@@ -1185,7 +1183,7 @@ func make_process(node: Node, process_count: int, current_infile: Array, slider_
 				var brk_data = entry[4]
 				var min_slider = entry[5]
 				var max_slider = entry[6]
-				var exp = entry[7]
+				var exponential = entry[7]
 				var fftwindowcount = entry[8]
 				var window_count
 				if fftwindowcount == true:
@@ -1218,7 +1216,7 @@ func make_process(node: Node, process_count: int, current_infile: Array, slider_
 								new_x = float(node.get_meta("outputduration")) + 0.1  # force last point's x to infile_length + 100ms to make sure the file is defo over
 							var new_y
 							#check if slider is exponential and scale automation
-							if exp:
+							if exponential:
 								new_y = remap_y_to_log_scale(point.y, 0.0, 255.0, min_slider, max_slider)
 							else:
 								new_y = remap(point.y, 255, 0, min_slider, max_slider) #slider value
@@ -1233,7 +1231,7 @@ func make_process(node: Node, process_count: int, current_infile: Array, slider_
 								new_x = infile_length + 0.1  # force last point's x to infile_length + 100ms to make sure the file is defo over
 							var new_y
 							#check if slider is exponential and scale automation
-							if exp:
+							if exponential:
 								new_y = remap_y_to_log_scale(point.y, 0.0, 255.0, min_slider, max_slider)
 							else:
 								new_y = remap(point.y, 255, 0, min_slider, max_slider) #slider value

+ 0 - 2
scenes/menu/explore_menu.gd

@@ -349,8 +349,6 @@ func _load_favourites(favourites: Array):
 			if favourites.has(key) == false:
 				continue
 				
-			var category = item.get("category", "")
-			var subcategory = item.get("subcategory", "")
 			var short_desc = item.get("short_description", "")
 			var command = key.replace("_", " ")