IMPORTANT: You are strongly advised to use a Web GUI for managing a playback queue. If you're using a web GUI, then you don't need to read this page at all.
Even when random playback is set using SOUND.randomOrder=true, the order tracks will be played is still predetermined. You are able to retreive the information about what tracks will be played next using the URL similar to this one:
http://localhost:8000/command?password=123&command=nexts&count=5
This will request 5 indexes of tracks that will be played next. It will return something like this:
{"result":1,"nexts":[5,87,32,0,9]}
Read more about HTTP request in MesonCast in the "Control and use stations" article.
Also, you can build a playback queue by yourself. There is a queue container in which you can put tracks. All tracks in this container will be played before a normal playback order will be restored. For example, let's assume that next tracks that will be played are:
3,6,2,8,9,...
but you want the track 5 to be played right after the current track. You should insert it in a queue. Run a request similar to the following:
http://localhost:8000/command?password=123&command=queue&index=5
then a playback queue will become like this:
5,3,6,2,8,9,...
Insert another track:
http://localhost:8000/command?password=123&command=queue&index=9
then a playback queue will become like this:
5,9,3,6,2,8,9,...
To insert a track to the beginning of a queue you should specify "pos" parameter:
http://localhost:8000/command?password=123&command=queue&index=76&pos=0
then a playback queue will become like this:
76,5,9,3,6,2,8,9,...
To get the tracks you've manually entered in your own queue, use this:
http://localhost:8000/command?password=123&command=queue&
This will give you the following:
{"result":1,"queue":[76,5,9]}
The one exception is when SOUND.randomOrder=false. In that case, when you add a track in a queue, the rest of playback queue may be altered. For example let's assume the current playback queue is as the following:
6,7,8,9,10,....
Insert a track in your custom queue:
http://localhost:8000/command?password=123&command=queue&index=53
The queue may become something like this:
53,54,55,56,57,...
Insert another one:
http://localhost:8000/command?password=123&command=queue&index=45
The queue will become something like this:
53,45,46,47,48
Note, that tracks that you entered manually will not be altered. You may get the tracks you've manually entered in your own queue:
http://localhost:8000/command?password=123&command=queue&
This will give you the following:
{"result":1,"queue":[53,45]}