aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/MusicConductor/SongInfo.gd
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/Game/MusicConductor/SongInfo.gd')
-rw-r--r--game/src/Game/MusicConductor/SongInfo.gd11
1 files changed, 9 insertions, 2 deletions
diff --git a/game/src/Game/MusicConductor/SongInfo.gd b/game/src/Game/MusicConductor/SongInfo.gd
index abcf120..527f618 100644
--- a/game/src/Game/MusicConductor/SongInfo.gd
+++ b/game/src/Game/MusicConductor/SongInfo.gd
@@ -3,9 +3,16 @@ class_name SongInfo
var song_path : String = ""
var song_name : String = ""
-var song_stream : Resource
+var song_stream : AudioStream
-func _init(dirname:String, fname:String) -> void:
+#Initialize from a file path
+func init_file_path(dirname : String, fname : String) -> void:
song_path = dirname.path_join(fname)
song_name = fname.get_basename().replace("_", " ")
song_stream = load(song_path)
+
+#Initialize from an audio stream
+func init_stream(dirpath : String, name : String, stream : AudioStream) -> void:
+ song_path = dirpath
+ song_name = name
+ song_stream = stream