Skip to content

Commit

Permalink
fix: radio getters
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Nov 14, 2024
1 parent aadc1ad commit 6dcd5c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ class Radio(private val symphony: Symphony) : Symphony.Hooks {

val hasPlayer get() = player?.usable == true
val isPlaying get() = player?.isPlaying == true
val currentPlaybackPosition = player?.playbackPosition
val currentSpeed = player?.speed ?: RadioPlayer.DEFAULT_SPEED
val currentPitch = player?.pitch ?: RadioPlayer.DEFAULT_PITCH
val audioSessionId = player?.audioSessionId
val currentPlaybackPosition get() = player?.playbackPosition
val currentSpeed get() = player?.speed ?: RadioPlayer.DEFAULT_SPEED
val currentPitch get() = player?.pitch ?: RadioPlayer.DEFAULT_PITCH
val audioSessionId get() = player?.audioSessionId
val onPlaybackPositionUpdate = Eventer<RadioPlayer.PlaybackPosition>()

var persistedSpeed = RadioPlayer.DEFAULT_SPEED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class RadioObservatory(private val symphony: Symphony) {
val playbackPosition = _playbackPosition.asStateFlow()
private val _queueIndex = MutableStateFlow(-1)
val queueIndex = _queueIndex.asStateFlow()
private val _queue = MutableStateFlow<List<String>>(emptyList())
private val _queue = MutableStateFlow(emptyList<String>())
val queue = _queue.asStateFlow()
private val _loopMode = MutableStateFlow(RadioLoopMode.None)
val loopMode = _loopMode.asStateFlow()
private val _shuffleMode = MutableStateFlow(false)
val shuffleMode = _shuffleMode.asStateFlow()
private val _sleepTimer = MutableStateFlow<Radio.SleepTimer?>(null)
val sleepTimer = _sleepTimer.asStateFlow()
private val _pauseOnCurrentSongEnd = MutableStateFlow<Boolean>(false)
private val _pauseOnCurrentSongEnd = MutableStateFlow(false)
val pauseOnCurrentSongEnd = _pauseOnCurrentSongEnd.asStateFlow()
private val _speed = MutableStateFlow(RadioPlayer.DEFAULT_SPEED)
val speed = _speed.asStateFlow()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class RadioPlayer(val symphony: Symphony, uri: Uri) {
private var onError: RadioPlayerOnErrorListener? = null
private var playbackPositionUpdater: Timer? = null

val playbackPosition: PlaybackPosition?
val playbackPosition
get() = mediaPlayer?.let {
try {
PlaybackPosition(
Expand Down

0 comments on commit 6dcd5c4

Please sign in to comment.