File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 133
133
134
134
function music :getPlaying ()
135
135
for name , source in pairs (self .loaded ) do
136
- if source : isPlaying ( ) then
136
+ if isActive ( source ) then
137
137
return name , source
138
138
end
139
139
end
@@ -147,7 +147,7 @@ function music:update()
147
147
end
148
148
end
149
149
if intromusic then
150
- if self .loaded [intromusic [1 ]] and not self .loaded [intromusic [1 ]]: isPlaying ( ) then
150
+ if self .loaded [intromusic [1 ]] and not isActive ( self .loaded [intromusic [1 ]]) then
151
151
music :play (intromusic [2 ], nil , true )
152
152
intromusic = false
153
153
end
156
156
157
157
function music :playingmusic ()
158
158
for name , source in pairs (self .loaded ) do
159
- if source ~= false and source : isPlaying ( ) then
159
+ if source and isActive ( source ) then
160
160
return true
161
161
end
162
162
end
Original file line number Diff line number Diff line change @@ -65,4 +65,16 @@ function hasvalue(tab, val)
65
65
end
66
66
end
67
67
return false
68
- end
68
+ end
69
+
70
+ function isPaused (source )
71
+ return pausedaudio and hasvalue (pausedaudio , source )
72
+ end
73
+
74
+ function isStopped (source )
75
+ return not source :isPlaying () and not isPaused (source )
76
+ end
77
+
78
+ function isActive (source )
79
+ return source :isPlaying () or isPaused (source )
80
+ end
You can’t perform that action at this time.
0 commit comments