NextSongProvider

class NextSongProvider(mSession: FeedSession)

This class keeps tracks of and provides music to different music sources like on Demand or station etc

Constructors

NextSongProvider
Link copied to clipboard
fun NextSongProvider(mSession: FeedSession)

Functions

cacheNextPlayInStation
Link copied to clipboard
suspend fun cacheNextPlayInStation(station: Station): Play?

Try to retrieve the next play for the given station. If one is retrieved, add it to the prepared plays and then return it. Else return null.

cachePlayForAudioFile
Link copied to clipboard
suspend fun cachePlayForAudioFile(audioFile: AudioFile): Play?

Try to convert the given audio file into a Play from the current music source. If successful, add it to the prepared plays array and return it. Else return null.

getCurrentStation
Link copied to clipboard
fun getCurrentStation(): Station?

Return current active station from the station music source

getPlayQueue
Link copied to clipboard
fun getPlayQueue(): PlayList

Retrieve the on demand play list

playCompleted
Link copied to clipboard
fun playCompleted(play: Play)
playStart
Link copied to clipboard
fun playStart(play: Play)

Report that the given play has started playback

requestNextPlay
Link copied to clipboard
suspend fun requestNextPlay(): Play?

Try to retrieve the 'next play' from the current music source. First look in the list of prepared plays and, failing that, request the next play from the current music source itself.

requestPlayForAudioFile
Link copied to clipboard
suspend fun requestPlayForAudioFile(audioFile: AudioFile): Play?

Try to convert an audio file into a play using the current music source

reset
Link copied to clipboard
fun reset()
reverse
Link copied to clipboard
suspend fun reverse(): Play?
setActiveStation
Link copied to clipboard
fun setActiveStation(station: Station)

Switch to a station music source and assign the active station

Properties

currentItem
Link copied to clipboard
var currentItem: Play?

Retrieve current play item from current music source

currentMusicSource
Link copied to clipboard
var currentMusicSource: AdaptrPlayer.MusicSource
mNextPlayInProgress
Link copied to clipboard
var mNextPlayInProgress: Boolean = false
nextItem
Link copied to clipboard
val nextItem: Play?

Retrieve next play item from current music source