extends Node3D

@onready var radio: Radio = $%Radio
@onready var button_pause_resume: Button = $%Button_Pause_Resume
@onready var settings_menu: SettingsMenu = $%SettingsMenu

func _on_button_play_pressed() -> void:
	if !radio.playing:
		radio.play_track()


func _on_button_pause_pressed() -> void:
	radio.toggle_pause()
	if !button_pause_resume:
		button_pause_resume = $%Button_Pause_Resume
	if radio.stream_paused:
		button_pause_resume.text = "Resume"
	else:
		button_pause_resume.text = "Pause"


func _on_button_stop_pressed() -> void:
	radio.stop_radio()


func _on_button_next_pressed() -> void:
	radio.next_track()


func _on_button_previous_pressed() -> void:
	radio.prev_track()


func _on_button_settings_menu_pressed() -> void:
	settings_menu.visible = !settings_menu.visible
