| 158 | === Set default pointer === |
| 159 | Before we can hit the play button we need to tell rpld what to play. |
| 160 | In our case we most likely have only one Playlist (created and imported above) and want to stream exactly this playlist. If we hit end of playlist we want it to repeat. On a normal player you would just select the first entry in your list and press 'repeat' button. rpld does not have something like that but something better!: Pointers. |
| 161 | |
| 162 | The full discussion on pointers, what they are and how they work is out of scope for this document. So I will try to make it as simple as possible: rpld normally plays back it's so called ''Main Queue''. If the queue (which must be manually filled) runs out of songs it stops. To avoid this pointers got invented. Those pointers are rules how to fill the ''Main Queue'' automatically if it runs out of songs to play. Basically they point to playlist entries (songs). This is where they got there name from. |
| 163 | |
| 164 | There are two pointers of interest for us: the so called ''current'' and the so called ''default'' pointer. The first one points to a song in a playlist which is played when the ''Main Queue'' runs out of songs. The song is queued and the pointer is moved to the next song in list. This allows us to play a playlist from top to bottom. If it reaches the end of the list it is unset and playback stops. So, now we only need to find out how to repeat the list, right? |
| 165 | |
| 166 | To repeat the playlist the ''default pointer'' was invented. It's simply, as the name says, the default value for the ''current pointer''. So if the playback would normally stop the ''current pointer'' just gets set to where the ''default pointer'' points to and playback continues. |
| 167 | |
| 168 | So all we need to do to repeat a playlist is to set the ''default pointer'' to the first entry. |
| 169 | If we press play the ''current pointer'' is set to the first song, the song is played back. If it reaches the end of the list it restarts as the ''current pointer'' is reset to the first song in list. |
| 170 | |
| 171 | Setting the pointer to the first song in list is very easy, just run: |
| 172 | {{{ |
| 173 | $ rpld-setpointer default num:0 'playlistname' |
| 174 | }}} |
| 175 | |
| 176 | Here ''default'' is the name of the pointer and ''num:0'' means the first entry in the list. |
| 177 | |