Files
tgcc/docs/museums/radio/museum_radio.tscn
2026-04-16 11:01:04 +02:00

89 lines
3.7 KiB
Plaintext

[gd_scene format=3 uid="uid://bdkdhn1oallke"]
[ext_resource type="PackedScene" uid="uid://cpeyt1dgrtglc" path="res://core/radio/radio.tscn" id="1_8yomj"]
[ext_resource type="Script" uid="uid://ew4b78u5tkiu" path="res://docs/museums/radio/museum_radio.gd" id="1_h5r8c"]
[ext_resource type="AudioStream" uid="uid://70cc8she43re" path="res://docs/museums/radio/lofi_01.ogg" id="3_ltpvc"]
[node name="MuseumRadio" type="Node3D" unique_id=204859062]
script = ExtResource("1_h5r8c")
[node name="Radio" parent="." unique_id=1234112225 instance=ExtResource("1_8yomj")]
unique_name_in_owner = true
playlist = Array[AudioStream]([ExtResource("3_ltpvc")])
[node name="Control" type="Control" parent="." unique_id=1232082176]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="VBoxContainer" type="VBoxContainer" parent="Control" unique_id=2097365775]
layout_mode = 0
offset_left = 50.0
offset_top = 50.0
offset_right = 125.0
offset_bottom = 221.0
[node name="Button_Play" type="Button" parent="Control/VBoxContainer" unique_id=1422696340]
layout_mode = 2
text = "Play"
[node name="Button_Pause_Resume" type="Button" parent="Control/VBoxContainer" unique_id=2016690081]
unique_name_in_owner = true
layout_mode = 2
text = "Pause"
[node name="Button_Stop" type="Button" parent="Control/VBoxContainer" unique_id=61861870]
layout_mode = 2
text = "Stop"
[node name="Button_Next" type="Button" parent="Control/VBoxContainer" unique_id=957606385]
layout_mode = 2
text = "Next"
[node name="Button_Previous" type="Button" parent="Control/VBoxContainer" unique_id=929072518]
layout_mode = 2
text = "Previous"
[node name="PanelContainer" type="PanelContainer" parent="Control" unique_id=1558442050]
layout_mode = 0
offset_left = 50.0
offset_top = 250.0
offset_right = 400.0
offset_bottom = 1027.0
[node name="ScrollContainer" type="ScrollContainer" parent="Control/PanelContainer" unique_id=7789304]
layout_mode = 2
[node name="Label" type="Label" parent="Control/PanelContainer/ScrollContainer" unique_id=2043293564]
custom_minimum_size = Vector2(1, 1)
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 1
text = "System Logic:
- The system is an extension of AudioStreamPlayer designed to manage sequential audio playback.
- It automatically triggers the next track in the sequence when the current one finishes via the finished signal.
Core Functionality:
- Playlist Management: Stores a list of AudioStream resources and tracks the current song index.
- Track Navigation: Allows cycling forward and backward through the playlist with index wrapping (loops back to start/end).
- Playback Control: Supports jumping to specific tracks, toggling the pause state, and stopping the stream.
Key Methods:
- play_track: Loads a specific stream from the playlist and begins playback.
- next_track / prev_track: Increments or decrements the index to navigate the playlist.
- toggle_pause: Resumes or pauses the current stream without resetting its position.
Adjustable Parameters:
- Playlist: An Array in the inspector where you can assign multiple AudioStream resources (e.g., .mp3, .ogg).
- Current Track Index: Determines which song starts playing by default."
autowrap_mode = 2
[connection signal="pressed" from="Control/VBoxContainer/Button_Play" to="." method="_on_button_play_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/Button_Pause_Resume" to="." method="_on_button_pause_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/Button_Stop" to="." method="_on_button_stop_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/Button_Next" to="." method="_on_button_next_pressed"]
[connection signal="pressed" from="Control/VBoxContainer/Button_Previous" to="." method="_on_button_previous_pressed"]