|
|
@ -114,7 +114,7 @@ public class RadioPlayer implements Device { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void next() { |
|
|
|
if (regionPlaylist.contains(playedStation)){ |
|
|
|
if (regionPlaylist.contains(playedStation)) { |
|
|
|
int currentIndex = regionPlaylist.indexOf(playedStation); |
|
|
|
int nextIndex = (currentIndex + 1) % regionPlaylist.size(); |
|
|
|
playedStation = regionPlaylist.get(nextIndex); |
|
|
@ -183,7 +183,9 @@ public class RadioPlayer implements Device { |
|
|
|
} |
|
|
|
|
|
|
|
public String saveStation() { |
|
|
|
savedPlaylist.add(playedStation); |
|
|
|
return ""; |
|
|
|
if (savedPlaylist.contains(playedStation)) return "Station " + playedStation + " is already saved"; |
|
|
|
else |
|
|
|
savedPlaylist.add(playedStation); |
|
|
|
return "Station " + playedStation + " is saved in your Station list"; |
|
|
|
} |
|
|
|
} |