|
@@ -1,36 +1,37 @@
|
|
|
extends Control
|
|
|
|
|
|
-onready var itemList = get_node("ItemList")
|
|
|
+onready var item_list = get_node("ItemList")
|
|
|
|
|
|
|
|
|
func _ready():
|
|
|
for item in AudioServer.get_device_list():
|
|
|
- itemList.add_item(item)
|
|
|
+ item_list.add_item(item)
|
|
|
|
|
|
var device = AudioServer.get_device()
|
|
|
- for i in range(itemList.get_item_count()):
|
|
|
- if device == itemList.get_item_text(i):
|
|
|
- itemList.select(i)
|
|
|
+ for i in range(item_list.get_item_count()):
|
|
|
+ if device == item_list.get_item_text(i):
|
|
|
+ item_list.select(i)
|
|
|
break
|
|
|
|
|
|
|
|
|
func _process(_delta):
|
|
|
- var speakerMode = "Stereo"
|
|
|
+ var speaker_mode_text = "Stereo"
|
|
|
+ var speaker_mode = AudioServer.get_speaker_mode()
|
|
|
|
|
|
- if AudioServer.get_speaker_mode() == AudioServer.SPEAKER_SURROUND_31:
|
|
|
- speakerMode = "Surround 3.1"
|
|
|
- elif AudioServer.get_speaker_mode() == AudioServer.SPEAKER_SURROUND_51:
|
|
|
- speakerMode = "Surround 5.1"
|
|
|
- elif AudioServer.get_speaker_mode() == AudioServer.SPEAKER_SURROUND_71:
|
|
|
- speakerMode = "Surround 7.1"
|
|
|
+ if speaker_mode == AudioServer.SPEAKER_SURROUND_31:
|
|
|
+ speaker_mode_text = "Surround 3.1"
|
|
|
+ elif speaker_mode == AudioServer.SPEAKER_SURROUND_51:
|
|
|
+ speaker_mode_text = "Surround 5.1"
|
|
|
+ elif speaker_mode == AudioServer.SPEAKER_SURROUND_71:
|
|
|
+ speaker_mode_text = "Surround 7.1"
|
|
|
|
|
|
$DeviceInfo.text = "Current Device: " + AudioServer.get_device() + "\n"
|
|
|
- $DeviceInfo.text += "Speaker Mode: " + speakerMode
|
|
|
+ $DeviceInfo.text += "Speaker Mode: " + speaker_mode_text
|
|
|
|
|
|
|
|
|
func _on_Button_button_down():
|
|
|
- for item in itemList.get_selected_items():
|
|
|
- var device = itemList.get_item_text(item)
|
|
|
+ for item in item_list.get_selected_items():
|
|
|
+ var device = item_list.get_item_text(item)
|
|
|
AudioServer.set_device(device)
|
|
|
|
|
|
|