Fixed volume. Also old changes which I don't know what they do. Seems to work.
[stereo.git] / CLI / src / clinterface / CLIPlaylist.java
blob110b4ffc336db7c1a33696f88a741153a5e8fa7c
1 package clinterface;
3 import interfaces.collection.AbstractCollection;
4 import interfaces.collection.Collection;
6 import java.util.ArrayList;
7 import java.util.Iterator;
8 import java.util.List;
10 import music.Track;
12 public class CLIPlaylist extends AbstractCollection<CLITrack> {
14 private final List<CLITrack> tracks = new ArrayList<CLITrack>();
15 private final String name;
17 private boolean root = false;
18 private int parent = 0;
19 private int specifiedSize;
21 public CLIPlaylist(int id, long persistent, String name) {
22 super(id, persistent);
23 this.name = name;
26 public String name() {
27 return name;
30 public void setRoot(boolean isRoot) {
31 this.root = isRoot;
34 public boolean isRoot() {
35 return root;
38 public void setParent(int parent) {
39 this.parent = parent;
42 public Collection<CLITrack> parent() {
43 //TODO store parents in accessible place so they can be retrieved
44 return null;
47 public void specifySize(int size) {
48 this.specifiedSize = size;
51 public int size() {
52 if (tracks.size() == 0) return specifiedSize;
53 else return tracks.size();
56 public boolean hasNext() {
57 throw new RuntimeException("should not be called on cli");
60 public CLITrack next() {
61 throw new RuntimeException("should not be called on cli");
64 public void add(CLITrack track) {
65 tracks.add(track);
68 public Iterable<? extends Track> tracks() {
69 return tracks;
72 public Iterator<CLITrack> iterator() {
73 return tracks.iterator();
76 public int editStatus() {
77 // TODO Auto-generated method stub
78 return 0;