summaryrefslogtreecommitdiff
path: root/core/src/kz/ilotterytea/maxon/audio
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/kz/ilotterytea/maxon/audio')
-rw-r--r--core/src/kz/ilotterytea/maxon/audio/Playlist.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/kz/ilotterytea/maxon/audio/Playlist.kt b/core/src/kz/ilotterytea/maxon/audio/Playlist.kt
index 10363a5..2e79f37 100644
--- a/core/src/kz/ilotterytea/maxon/audio/Playlist.kt
+++ b/core/src/kz/ilotterytea/maxon/audio/Playlist.kt
@@ -12,6 +12,11 @@ class Playlist(vararg musics: Music) {
private var index = 0
var shuffleMode = false
+ var volume = 1f
+ set(value) {
+ playingNow.volume = value
+ field = value
+ }
/**
* Play next music.
@@ -22,13 +27,14 @@ class Playlist(vararg musics: Music) {
if (shuffleMode) {
index = Math.getRandomNumber(0, playlist.size - 1)
playingNow = playlist[index]
- playingNow.play()
} else {
index++
if (index > playlist.size - 1) index = 0
playingNow = playlist[index]
- playingNow.play()
}
+
+ playingNow.volume = volume
+ playingNow.play()
}
} \ No newline at end of file