QueueConfig

data class QueueConfig(val preloadNext: Duration = 5.seconds, val gapless: Boolean = true, val reshuffleEachLap: Boolean = false, val onItemFailure: QueueItemFailure = QueueItemFailure.Stop)

How the player moves from one queue item to the next. See docs/gapless-queue.md.

With the defaults the next item opens in the background five seconds before the current one ends, and its sound follows the last sample of the current item on the same audio device, with no silence between them. A repeat of the current item follows its own end the same way (#467). PlaybackWarning.GaplessFallback says when an item opened the old way.

Constructors

Link copied to clipboard
constructor(preloadNext: Duration = 5.seconds, gapless: Boolean = true, reshuffleEachLap: Boolean = false, onItemFailure: QueueItemFailure = QueueItemFailure.Stop)

Properties

Link copied to clipboard

Hand the audio device from one item to the next without stopping it. Needs preloadNext above zero. False keeps the old path for every item and preloads nothing: the device stops at the end of an item, and the next item opens from scratch.

Link copied to clipboard

What the queue does when an item cannot be opened, such as a moved file, an address that answers 404 or a format this build cannot decode (#487). QueueItemFailure.Stop keeps the player in PlaybackStatus.Failed on that item, for an application that handles the error itself. QueueItemFailure.Skip moves on, as mpv does: see there.

Link copied to clipboard

Open and prime the next item this long before the current one ends, for the gapless handoff. Zero turns preloading off, and with it the handoff.

Link copied to clipboard

With shuffle and LoopMode.All on, draw a fresh order each time the queue comes round instead of playing the first order again on every lap (#488). The new lap never starts with the item that ended the last one, and it comes from the shuffle's own random source, so a seeded shuffle stays reproducible. False keeps one order for every lap.