Chapter 2. Recipes

Table of Contents

Queuing

Queuing

Often, users run MPD with "random" enabled, but want to be able to insert songs "before" the rest of the playlist. That is commonly called "queuing".

MPD implements this by allowing the client to specify a "priority" for each song in the playlist (commands prio and prioid). A higher priority means that the song is going to be played before the other songs.

In "random" mode, MPD maintains an internal randomized sequence of songs. In this sequence, songs with a higher priority come first, and all songs with the same priority are shuffled (by default, all songs are shuffled, because all have the same priority "0"). When you increase the priority of a song, it is moved to the front of the sequence according to its new priority, but always after the current one. A song that has been played already (it's "before" the current song in that sequence) will only be scheduled for repeated playback if its priority has become bigger than the priority of the current song. Decreasing the priority of a song will move it farther to the end of the sequence. Changing the priority of the current song has no effect on the sequence. During playback, a song's priority is reset to zero.