1 package util
.command
.ctrlint
;
3 import interfaces
.DJInterface
;
4 import interfaces
.Track
;
5 import interfaces
.collection
.Collection
;
7 import java
.math
.BigInteger
;
10 import util
.command
.Command
;
11 import util
.queryparser
.QueryParser
;
12 import util
.queryparser
.Token
;
15 public class PlaySpec
implements Command
{
17 private String playlist
;
19 public void init(Map
<String
, String
> args
) {
20 playlist
= args
.get("playlist-spec");
23 public Response
run(DJInterface dj
) {
25 Token t
= (Token
)QueryParser
.parse(playlist
);
27 long playlist
= new BigInteger(t
.value
).longValue();
29 for (Collection
<?
extends Track
> c
: dj
.library().collections()) {
30 if (c
.persistentId() == playlist
) {
31 System
.out
.println("playlist set: " + c
.name());
32 dj
.playbackControl().setSource(c
.source());
36 return new Response(null, Response
.NO_CONTENT
);